Problem/Motivation

The field to set the quantity of classes per block is appearing when the field type is textfield or textarea, but it's wrong because this one will be used only with multiple items

Steps to reproduce

Go to settings page
Set field type = multi items
Set the field qty_classes_per_block = 10
Save
Open the settings page again
Update the field type to fieldset or textarea
Take a look on field "Quantity of classes per block"
Result: This field continue appering wrongly
Expected: This field shoul appear only for fieldtype = "Multiple items" because is the only used

Proposed resolution

We can implement a Drupal Form States API to remove this field when isn't necessary https://www.drupal.org/docs/drupal-apis/form-api/conditional-form-fields

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#2 3271394.patch741 bytesrenatog

Comments

RenatoG created an issue. See original summary.

renatog’s picture

StatusFileSize
new741 bytes

Patch with the logic to remove this field when the field type is different than multiple

  • RenatoG committed f401a3b on 2.0.x
    Issue #3271394 by RenatoG: Settings for quantity of classes appearing...
renatog’s picture

Status: Active » Fixed

Fixed and committed to the 2.0.x-dev branch version. Thanks

Status: Fixed » Closed (fixed)

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