Fix UI limit setting

Created on 15 March 2024, 10 months ago
Updated 30 March 2024, 10 months ago

Problem/Motivation

Since version 3.19, the UI limit setting is missing from multi-value fields.

<!--break-->

Looks like a regression from 🐛 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). Fixed , 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

🐛 Bug report
Status

Fixed

Version

3.0

Component

Field UI

Created by

🇩🇪Germany mrshowerman Munich

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024