Commit 2f381cfb authored by ephoto_dam's avatar ephoto_dam

Ephoto Dam Field in progress

parent f3da456e
......@@ -90,7 +90,7 @@ class EphotoDamFieldWidget extends WidgetBase {
$classes = ['ephoto-dam-field-field', 'ephoto-dam-field-version-field'];
$prefix_classes = ['ephoto-dam-field-version-prefix'];
if (!$version_support) {
if (!$version_support || (!$is_default_values_form && empty($items[$delta]->version))) {
$classes[] = 'ephoto-dam-field-hidden';
$prefix_classes[] = 'ephoto-dam-field-hidden';
}
......@@ -98,7 +98,7 @@ class EphotoDamFieldWidget extends WidgetBase {
$element['version'] = [
'#type' => 'textfield',
'#title' => ' ',
'#default_value' => !empty($items[$delta]->version) ? $items[$delta]->version : ($is_default_values_form ? null : $this->t('Current version')),
'#default_value' => !empty($items[$delta]->version) ? $items[$delta]->version : null,
'#size' => 10,
'#maxlength' => 60,
'#field_prefix' => '<span class="' . implode(' ', $prefix_classes). '">, &nbsp;' . $this->t('version') . '</span>',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment