Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
I use this module with inline_entity_form and entity_browser.
If I select images once and then delete them the field is empty but I get a Constraint Message (At least one slideshow item must exist.)
Imho we should not put this constraint if the field is not required it should be allowed to be empty.
Proposed resolution
Improve if statement in ItemsCountConstraintValidator
Comment | File | Size | Author |
---|---|---|---|
#8 | 3015310_allow_field_to_be_empty_4.patch | 2.06 KB | Antoniya |
| |||
#7 | 3015310_allow_field_to_be_empty_3.patch | 2 KB | Antoniya |
| |||
#2 | 3015310_allow_field_to_be_empty_2.patch | 708 bytes | DiDebru |
Comments
Comment #2
DiDebruComment #3
RumenDamyanovThank you for the patch. I tested it and it works as intended.
Comment #4
Shenron_segamag CreditAttribution: Shenron_segamag commentedI can also confirm that the patch works.
Comment #5
Antoniya CreditAttribution: Antoniya commentedTested this against core 9.1.7 and media_entity_slideshow 2.4. I'd say it's ready to be committed.
Comment #7
Antoniya CreditAttribution: Antoniya commentedUpdated the failing test.
Comment #8
Antoniya CreditAttribution: Antoniya commentedMinor coding standard issue. Triggering the test bot again.