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.
When specifying a max queue size, users can continue to add more than max items to the queue before they hit save.
Once they click save, an error shows up notifying them they cannot pass the queue size limit. This is okay, but it would be better if instead it just limited the number of item fields to the max size. I.e., if the max is 6, then when I add the 6th item to the list, I shouldn't have an option to add a 7th item.
Comment | File | Size | Author |
---|---|---|---|
#3 | 3021483.patch | 740 bytes | amateescu |
Comments
Comment #2
jsheffers CreditAttribution: jsheffers as a volunteer commentedI agree that this would be a good addition to the module. Furthermore, it would also be helpful in some cases to not show the "Add another button" at all. An example would be a simple entityqueue that has minimum and maximum of 4 items. I only want it to ever contain 4 items. On the edit items screen I would see 4 autocomplete fields and the content could only be replaced with a different reference instead of adding a new item and kicking it out of the queue. Possible?
Comment #3
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedIt's very much possible, and quite easy to accomplish too: we can set the cardinality of the
items
field based on the "max size" setting of the queue :)Committed the patch attached to 8.x-1.x.
Comment #6
justcaldwellJust wanted to note a couple of side-effects/regressions that seem to be associated with this change:
items
field should be conditional on the 'Act as queue' setting?Comment #7
justcaldwellI opened new tickets for the issues above:
Comment #8
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedAnother bug caused by this patch: #3055520: Simple queue with a minimum of 0 and maximum of 1 items creates error.
It's funny that such a small change managed to break so many things :/