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 a followup to https://drupal.org/node/2011578#comment-7762747.
Summary
Previously, as part of converting Stark's html template and maintenance page conversions to twig, maintenance.html.twig's html
tag became descrepant with html.html.twig's:
html.html.twig
<!DOCTYPE html>
<html{{ html_attributes }}>
<head>
...
maintenance.html.twig
<!DOCTYPE html>
<html>
<head>
...
This is an error: HTML attributes such as dir
and lang
will not be printed on maintenance pages in this case.
Comment | File | Size | Author |
---|---|---|---|
#12 | restore-html-attributes-maintainance-pages-2067915-11.patch | 2.08 KB | bserem |
#9 | drupal-2067915-9.patch | 2.08 KB | kjay |
#9 | interdiff.txt | 1.08 KB | kjay |
#4 | maint-page-html-attributes-2067915-3.patch | 1.15 KB | eatings |
#3 | maint-page-html-attributes-2067915-2.patch | 1.16 KB | eatings |
Comments
Comment #1
eatingsHere's a patch.
Comment #3
eatingsWhoops,
template_preprocess_maintenance_page
didn't define thehtml_attributes
array before. Now it does.Comment #4
eatingsSlightly more clear comment, otherwise identical code to prior patch.
Comment #5
eatingsTagging as twig.
Comment #6
eatingsTagging Stark and dreammarkup as well.
Comment #7
star-szrThanks for this @eatings!
No space between html and {{ html_attributes }}
Comment #8
star-szrIt might make sense to make seven and bartik's maintenance-page.html.twig use html_attributes as well in this issue.
Comment #9
kjay CreditAttribution: kjay commentedAddressed the space issue as raised in #7
Addressed issue raised in #8 for Seven and Bartik not having the html_attributes
Comment #10
bserem CreditAttribution: bserem commentedthere ending " (quote sign) is not required
same goes for this line
Comment #11
bserem CreditAttribution: bserem commented(double post due to connectivity issues, sorry)
Comment #12
bserem CreditAttribution: bserem commentedproviding patch below
Comment #13
kostask CreditAttribution: kostask commentedManually tested and the attributes are there on the maintenance page on all the core themes.
Comment #14
Dries CreditAttribution: Dries commentedCommitted to 8.x. Thanks!