Problem/Motivation
Since version 3.19, the UI limit setting is missing from multi-value fields.
Looks like a regression from #3418407: Error: Call to undefined method Drupal\ds\Form\BlockFieldConfigForm::getEntity() in ds_field_formatter_third_party_settings_form() (line 1060 of modules/contrib/ds/ds.module)., where the cardinality check was changed:
@@ -1064,7 +1070,7 @@ function ds_field_formatter_third_party_settings_form(FormatterInterface $plugin
}
$field_info = $field_definition->getFieldStorageDefinition();
- if ($field_info->getCardinality() != 1) {
+ if ($field_info->getCardinality() != FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED) {
$name = $field_info->getName();
$settings = $form_state->get('plugin_settings');
This seems to be wrong, since FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED
equals to -1, not 1.
Proposed resolution
Revert the change in ds_module, line 1077.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork ds-3428038
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
mrshowermanComment #4
swentel CreditAttribution: swentel at eps & kaas commentedHmm, right, where on earth was my mind that moment :)
Comment #6
swentel CreditAttribution: swentel at eps & kaas commentedMerged, thanks!