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.
This is also in the twig conversion. But I'm concerned about that #element => $element there too because of the weird way that 'render element' treats the incoming variables through drupal_render(). In this case form_required_marker doesn't use any incoming variables so it should pass tests no problem. A quick test that that the $variables['element'] has the right things on that required marker. If I get a chance I'll do that, otherwise someone may want to jump on that.
It's true, the $element passed as #element is not needed for theme_form_required_marker. We could just as easily pass an empty array since the $variables argument to the theme function is never referenced in the theme function.
I would rather deal with that weirdness in #2152215: Convert theme_form_element_label() to Twig, where the mandate is to untangle these inconsistencies and introduce a TWIG template. This issue here is simply concerned with eliminating calls to theme(), which we can safely do with the patch in #3.
Comments
Comment #1
star-szrThanks!
Should have a comma after $element.
Comment #3
jessebeach CreditAttribution: jessebeach commentedComma added.
Comment #4
joelpittet#2152215: Convert theme_form_element_label() to Twig
This is also in the twig conversion. But I'm concerned about that #element => $element there too because of the weird way that
'render element'
treats the incoming variables throughdrupal_render()
. In this caseform_required_marker
doesn't use any incoming variables so it should pass tests no problem. A quick test that that the $variables['element'] has the right things on that required marker. If I get a chance I'll do that, otherwise someone may want to jump on that.Comment #5
joelpittetDemo of test breaks and what I mean.
Comment #7
joelpittetWhoops
Comment #8
jessebeach CreditAttribution: jessebeach commentedIt's true, the
$element
passed as#element
is not needed fortheme_form_required_marker
. We could just as easily pass an empty array since the$variables
argument to the theme function is never referenced in the theme function.I would rather deal with that weirdness in #2152215: Convert theme_form_element_label() to Twig, where the mandate is to untangle these inconsistencies and introduce a TWIG template. This issue here is simply concerned with eliminating calls to
theme()
, which we can safely do with the patch in #3.Comment #10
martin107 CreditAttribution: martin107 commented+1 on #8 -- untangle inconsistencies has it place ... in another issue.
Comment #11
joelpittet7: 2190427-form-render-element-breaking.patch queued for re-testing.
Comment #12
joelpittetThe problem has been made aware to all involved and will be dealt with in the twig conversion. I'm RTBCing this as to not hold this up:)
Comment #14
joelpittetSorry messed this up... RTBC #3
Comment #15
star-szrHiding everything but #3 :)
Comment #16
webchickCommitted and pushed to 8.x. Thanks!