Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
What is the reason that the _msnf_element_unset_required() function uses $depth to limit the number of recursions?
Seems like that would make it possible to miss some elements, plus even without the depth the function should not recurse forever, it will only recurse until there are no more children.
I would think it should be like this:
<?php
function _msnf_element_unset_required(&$element) {
foreach (element_children($element) as $key) {
_msnf_element_unset_required($element[$key]);
}
if (isset($element['#required'])) {
$element['#required'] = FALSE;
}
}
?>
Comments
Comment #1
rooby CreditAttribution: rooby commentedSame goes for _msnf_fieldgroup_has_element()