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

Command icon 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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mrshowerman created an issue. See original summary.

mrshowerman’s picture

Assigned: mrshowerman » Unassigned
Issue summary: View changes
Status: Active » Needs review
swentel’s picture

Hmm, right, where on earth was my mind that moment :)

swentel’s picture

Status: Needs review » Fixed

Merged, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.