Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Multigroup module disables "required" flag for fields in multigroups in the after_build callback to apply custom validation logics. Later in pre_render callback the required flag is restored to show the "required" marks. This works fine on normal form rendering, but when rerendering form after error, it doesn't - "required" marks are missing.
Comment | File | Size | Author |
---|---|---|---|
#3 | content_multigroup_2406589_3.patch | 1.2 KB | crea |
Comments
Comment #1
crea CreditAttribution: crea commentedAttached patch fixes the bug. The problem is that in order to find "required" fields and restore "required" flag for them, Multigroup module relies on "#parents" array, which is different on form submission (since it reflects hierarchy of the submitted values). Switching it to use "#array_parents" solves the problem.
See https://www.drupal.org/node/279246#comment-2292322
Comment #2
crea CreditAttribution: crea commentedComment #3
crea CreditAttribution: crea commentedBetter coding style