Loading reference_option_limit.module +8 −3 Original line number Diff line number Diff line Loading @@ -417,10 +417,13 @@ function reference_option_limit_field_attach_form($entity_type, $entity, &$form, // @todo: Figure out what on earth should happen when we have more than one column! $column = $match_columns[$field_name_matching][0]; if ($values_field_matching) { foreach ($values_field_matching as $delta => $item) { $match_values[$field_name_matching][$delta] = $item[$column]; } } } else { // This is an initial build of the form for a new entity. // Rather than look at the default values in the form, where different Loading Loading @@ -516,7 +519,9 @@ function reference_option_limit_field_attach_form($entity_type, $entity, &$form, // to get a properties array to pass to _options_prepare_options(). $type = str_replace('options_', '', $field_instance_option_limited['widget']['type']); $multiple = $field_option_limited['cardinality'] > 1 || $field_option_limited['cardinality'] == FIELD_CARDINALITY_UNLIMITED; $required = $element_limited[LANGUAGE_NONE]['#required']; $required = $element_limited[LANGUAGE_NONE]['#required'] ?? FALSE; $has_value = TRUE; // isset($items[0][$value_key]); ????? $properties = _options_properties($type, $multiple, $required, $has_value); Loading Loading
reference_option_limit.module +8 −3 Original line number Diff line number Diff line Loading @@ -417,10 +417,13 @@ function reference_option_limit_field_attach_form($entity_type, $entity, &$form, // @todo: Figure out what on earth should happen when we have more than one column! $column = $match_columns[$field_name_matching][0]; if ($values_field_matching) { foreach ($values_field_matching as $delta => $item) { $match_values[$field_name_matching][$delta] = $item[$column]; } } } else { // This is an initial build of the form for a new entity. // Rather than look at the default values in the form, where different Loading Loading @@ -516,7 +519,9 @@ function reference_option_limit_field_attach_form($entity_type, $entity, &$form, // to get a properties array to pass to _options_prepare_options(). $type = str_replace('options_', '', $field_instance_option_limited['widget']['type']); $multiple = $field_option_limited['cardinality'] > 1 || $field_option_limited['cardinality'] == FIELD_CARDINALITY_UNLIMITED; $required = $element_limited[LANGUAGE_NONE]['#required']; $required = $element_limited[LANGUAGE_NONE]['#required'] ?? FALSE; $has_value = TRUE; // isset($items[0][$value_key]); ????? $properties = _options_properties($type, $multiple, $required, $has_value); Loading