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.
In certain scenarios, form error messages are keyed by the element ID, rather than numerically.
In a Zen subtheme, this means that if there is only one error, it will not be displayed, and the following notice appears:
Notice: Undefined offset: 0 in zen_status_messages() (line 679 of /www/b2b/releases/20150623213042/profiles/b2bprofile/themes/zen/template.php).
This has happened due to some custom code in our site, but the issue doesn't occur in bartik.
Comment | File | Size | Author |
---|---|---|---|
#4 | single_form_error-2516054-4.patch | 329 bytes | malcomio |
#1 | single_form_error-2516054-1.patch | 327 bytes | malcomio |
Comments
Comment #1
malcomio CreditAttribution: malcomio commentedComment #2
malcomio CreditAttribution: malcomio commentedComment #3
star-szrThanks @malcomio! See this core issue: #1946240: Remove the hardcoded 0 index in theme_status_messages() (why it works in Bartik), reset() is more appropriate here.
Comment #4
malcomio CreditAttribution: malcomio commentedThanks - here's the patch with reset instead of end
Comment #5
star-szrLooks good!
Comment #8
JohnAlbinThanks, Malcolm!