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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

eatings’s picture

Status: Active » Needs review
FileSize
424 bytes

Here's a patch.

Status: Needs review » Needs work

The last submitted patch, maint-page-html-attributes-2067915.patch, failed testing.

eatings’s picture

Status: Needs work » Needs review
FileSize
1.16 KB

Whoops, template_preprocess_maintenance_page didn't define the html_attributes array before. Now it does.

eatings’s picture

Slightly more clear comment, otherwise identical code to prior patch.

eatings’s picture

Issue tags: +Twig

Tagging as twig.

eatings’s picture

Issue tags: +Stark, +dreammarkup

Tagging Stark and dreammarkup as well.

star-szr’s picture

Status: Needs review » Needs work

Thanks for this @eatings!

+++ b/core/modules/system/templates/maintenance-page.html.twig
@@ -13,7 +13,7 @@
-<html>
+<html {{ html_attributes }}>

No space between html and {{ html_attributes }}

star-szr’s picture

It might make sense to make seven and bartik's maintenance-page.html.twig use html_attributes as well in this issue.

kjay’s picture

Status: Needs work » Needs review
FileSize
1.08 KB
2.08 KB

Addressed the space issue as raised in #7

Addressed issue raised in #8 for Seven and Bartik not having the html_attributes

bserem’s picture

Status: Needs review » Needs work
  1. +++ b/core/themes/bartik/templates/maintenance-page.html.twig
    @@ -11,7 +11,7 @@
    +<html{{ html_attributes }}">
    

    there ending " (quote sign) is not required

  2. +++ b/core/themes/bartik/templates/maintenance-page.html.twig
    @@ -11,7 +11,7 @@
    +<html{{ html_attributes }}">
    

    same goes for this line

bserem’s picture

Status: Needs review » Needs work

(double post due to connectivity issues, sorry)

bserem’s picture

Status: Needs work » Needs review
FileSize
2.08 KB

providing patch below

kostask’s picture

Status: Needs work » Reviewed & tested by the community

Manually tested and the attributes are there on the maintenance page on all the core themes.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.