Issue #1987426 by shanethehat, Cottser, intergalactic overlords, mr.baileys: Convert maintenance-page.tpl.php to Twig.

(as of #24)

Task

Convert PHPTemplate template to Twig template.

Remaining

  • PHPTemplate -> Twig conversions (and preprocess function additions or changes) moved over from the existing conversion issue
  • Patch review
  • Profiling
Template path Conversion status
core/modules/system/templates/maintenance-page.tpl.php @todo move from #1885564: theme.maintenance.inc (authorize.php) - Convert theme_ functions to Twig

Profiling results

=== maintenance-8.x..maintenance-8.x compared (5198e3e70582e..5198e40fe548a):

ct  : 16,779|16,779|0|0.0%
wt  : 107,215|107,272|57|0.1%
cpu : 92,854|91,872|-982|-1.1%
mu  : 8,880,128|8,880,128|0|0.0%
pmu : 8,954,144|8,954,144|0|0.0%

http://www.lionsad.de/xhprof-kit/xhprof/xhprof_html/?run1=5198e3e70582e&...

=== maintenance-8.x..maintenance-1987426-8 compared (5198e3e70582e..5198e42044d2e):

ct  : 16,779|16,913|134|0.8%
wt  : 107,215|107,756|541|0.5%
cpu : 92,854|93,301|447|0.5%
mu  : 8,880,128|8,928,920|48,792|0.5%
pmu : 8,954,144|8,996,048|41,904|0.5%

http://www.lionsad.de/xhprof-kit/xhprof/xhprof_html/?run1=5198e3e70582e&...

Manual testing steps

  • maintenance-page.html.twig - set default theme to Stark, enable maintenance mode, and view the site as an anonymous user.

#1885564: theme.maintenance.inc (authorize.php) - Convert theme_ functions to Twig
#1757550: [Meta] Convert core theme functions to Twig templates
#1987510: [meta] Convert all core *.tpl.php templates to Twig as singular patch

Comments

star-szr’s picture

Issue summary: View changes

Updated issue summary.

c4rl’s picture

Issue summary: View changes

Updated issue summary.

c4rl’s picture

Issue summary: View changes

List templates

shanethehat’s picture

Assigned: Unassigned » shanethehat
shanethehat’s picture

Assigned: shanethehat » Unassigned
Status: Active » Needs review
StatusFileSize
new6.38 KB

Status: Needs review » Needs work

The last submitted patch, twig-maintainence-page-template-1987426-2.patch, failed testing.

shanethehat’s picture

Status: Needs work » Needs review
StatusFileSize
new10 KB
new9.78 KB

Fixed spelling mistake on file name, and corrected a few missed documentation references.

Status: Needs review » Needs work
Issue tags: -needs profiling, -Twig

The last submitted patch, twig-maintainance-page-template-only-1987426-4.patch, failed testing.

shanethehat’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work
Issue tags: +needs profiling, +Twig

The last submitted patch, twig-maintainance-page-template-only-1987426-4.patch, failed testing.

star-szr’s picture

Status: Needs work » Needs review
StatusFileSize
new1.52 KB
new9.99 KB

The template filename needed another quick fix-up and I tweaked some docs. Thanks for getting this going @shanethehat :)

jenlampton’s picture

do we need to add bartik and seven's override of this template file into this issue as well?

For now I'm leaving seven's conversion over in #1938848: seven.theme - Convert PHPTemplate templates to Twig
And bartik's is in #1938840: bartik.theme - Convert PHPTemplate templates to Twig

star-szr’s picture

@jenlampton - we could move them here but I see no need, testbot is happy with them being separate.

intergalactic overlords’s picture

Status: Needs review » Reviewed & tested by the community

twig returns same html as tpl.php

intergalactic overlords’s picture

Status: Reviewed & tested by the community » Needs review

Have been a bit overeager I guess. Anyhow, this has been manually tested.

hydra’s picture

Twig template is working well as far as I can see. What are your concenrns @intergalactic overlords? For me this seems RTBC.

intergalactic overlords’s picture

Status: Needs review » Reviewed & tested by the community

You are right, it is working great. I was confused about when I could change the patch status to 'reviewed & tested by the community'.

star-szr’s picture

StatusFileSize
new1.64 KB
new8.35 KB

Thanks for the reviews!

Just removing the changes to bartik.theme and seven.theme, they are identical to the changes made in #1938840: bartik.theme - Convert PHPTemplate templates to Twig and #1938848: seven.theme - Convert PHPTemplate templates to Twig. No other changes.

hydra’s picture

Looks good to me =)

mr.baileys’s picture

Assigned: Unassigned » mr.baileys

Assigning to me to take care of profiling.

mr.baileys’s picture

$ bbranch
loop time: |0.046229s|519912561bed9|drupal-perf|8.x|<a href="http://d8.localhost/xhprof-kit/xhprof/xhprof_html/index.php?source=drupal-perf&url=%2F&run=519912561bed9&extra=8.x" target="_blank">Profiler output</a>
$ bbranches 519912561bed9 1987426
=== 8.x..8.x compared (519912561bed9..5199127bcedfa):

ct  : 5,914|5,914|0|0.0%
wt  : 46,296|45,760|-536|-1.2%
cpu : 48,002|44,002|-4,000|-8.3%
mu  : 5,206,600|5,206,600|0|0.0%
pmu : 5,221,160|5,221,160|0|0.0%

<a href="http://d8.localhost/xhprof-kit/xhprof/xhprof_html/index.php?source=drupal-perf&url=%2F&run1=519912561bed9&run2=5199127bcedfa&extra=8.x..8.x">Profiler output</a>

=== 8.x..1987426 compared (519912561bed9..519912882c776):

ct  : 5,914|6,463|549|9.3%
wt  : 46,296|68,134|21,838|47.2%
cpu : 48,002|52,003|4,001|8.3%
mu  : 5,206,600|5,433,408|226,808|4.4%
pmu : 5,221,160|5,468,584|247,424|4.7%

<a href="http://d8.localhost/xhprof-kit/xhprof/xhprof_html/index.php?source=drupal-perf&url=%2F&run1=519912561bed9&run2=519912882c776&extra=8.x..1987426">Profiler output</a>

---
ct = function calls, wt = wall time, cpu = cpu time used, mu = memory usage, pmu = peak memory usage

Did 4 separate runs, getting the same numbers consistently.

star-szr’s picture

I did this one on the plane, this needs special treatment. Will post results later today.

mr.baileys’s picture

Assigned: mr.baileys » Unassigned
star-szr’s picture

Issue tags: -needs profiling

Added this to the end of template_preprocess_maintenance_page():

  $node = node_load(1);
  $variables['content'] .= theme('node', node_view($node));

Loading the extra node is for the purpose of isolating profiling to this conversion only, not loading all of the Twig classes etc.

=== maintenance-8.x..maintenance-8.x compared (5198e3e70582e..5198e40fe548a):

ct  : 16,779|16,779|0|0.0%
wt  : 107,215|107,272|57|0.1%
cpu : 92,854|91,872|-982|-1.1%
mu  : 8,880,128|8,880,128|0|0.0%
pmu : 8,954,144|8,954,144|0|0.0%

http://www.lionsad.de/xhprof-kit/xhprof/xhprof_html/?run1=5198e3e70582e&...

=== maintenance-8.x..maintenance-1987426-8 compared (5198e3e70582e..5198e42044d2e):

ct  : 16,779|16,913|134|0.8%
wt  : 107,215|107,756|541|0.5%
cpu : 92,854|93,301|447|0.5%
mu  : 8,880,128|8,928,920|48,792|0.5%
pmu : 8,954,144|8,996,048|41,904|0.5%

http://www.lionsad.de/xhprof-kit/xhprof/xhprof_html/?run1=5198e3e70582e&...

star-szr’s picture

Issue summary: View changes

Updated summary

thedavidmeister’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: +Needs manual testing

oops, I don't think this was ever manually tested.

thedavidmeister’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs manual testing

My bad. See #12 for manual testing confirmation.

alexpott’s picture

Title: Convert maintenance-page.tpl.php to Twig » [READY] Convert maintenance-page.tpl.php to Twig
Status: Reviewed & tested by the community » Closed (duplicate)
alexpott’s picture

Issue summary: View changes

Add profiling results

alexpott’s picture

Title: [READY] Convert maintenance-page.tpl.php to Twig » Convert maintenance-page.tpl.php to Twig
Status: Closed (duplicate) » Fixed

Committed d7f5a1a and pushed to 8.x. Thanks!

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

Anonymous’s picture

Issue summary: View changes

Updated issue summary.