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.
Task
Use Twig instead of PHPTemplate
Remaining
Theme function name/template path | Conversion status |
---|---|
theme_common_test_foo | converted |
Related
#1757550: [Meta] Convert core theme functions to Twig templates
Comment | File | Size | Author |
---|---|---|---|
#8 | drupal-twig-common_test-1898456-8.patch | 1.36 KB | joelpittet |
#8 | interdiff.txt | 647 bytes | joelpittet |
#7 | drupal-twig-common_test-1898456-7.patch | 1.36 KB | joelpittet |
#7 | interdiff.txt | 694 bytes | joelpittet |
#5 | interdiff.txt | 1.4 KB | joelpittet |
Comments
Comment #1
c4rl CreditAttribution: c4rl commentedTagging
Comment #2
joelpittetComment #3
joelpittetHere's a rough one:)
Comment #5
joelpittetRemoved the unnecessary template_preprocess and added some white space modifiers to help it pass the simpletests.
Comment #6
star-szrNice! The only thing I see is we should remove the unnecessary preprocess from the Twig file's docblock too.
Comment #7
joelpittetGood call.
Comment #8
joelpittetRemoved the front whitespace modifier because @steveoliver suggested it is unnessasry and the twig docs mention the newline after the docblock is removed automatically.
http://twig.sensiolabs.org/doc/templates.html#whitespace-control
Crosses fingers.
Comment #9
tlattimore CreditAttribution: tlattimore commentedIt seems like our tests should be ignore whitespace that shows up when checking against stuff - rather than the *exact string. But thats a whole other discussion..
The patch from #8 looks good to me. Always glad to see where we can drop a theme/preprocess altogether. I have heard some various opinions in irc on the whitespace control for these conversions, but I personally am okay with it. Especially if whitespace is the only thing keeping the test from passing.
Comment #10
star-szr#8: drupal-twig-common_test-1898456-8.patch queued for re-testing.
Comment #11
star-szrRTBC if it comes back green. Good work @joelpittet :)
Comment #11.0
star-szrAdd conversion summary table
Comment #12
c4rl CreditAttribution: c4rl commentedPer #1757550-44: [Meta] Convert core theme functions to Twig templates, retitling to indicate this issue applies to theme_ functions, which are lower in priority than PHPTemplate conversion issues.
Comment #13
alexpottComment #14
epersonae2 CreditAttribution: epersonae2 commented#8: drupal-twig-common_test-1898456-8.patch queued for re-testing.
Comment #16
joshmillerAbout to re-roll
Comment #17
johannez CreditAttribution: johannez commented#8: drupal-twig-common_test-1898456-8.patch queued for re-testing.
Comment #18
rwohlebRunning profile on drupal-twig-common_test-1898456-8.patch
Comment #19
rwohleb=== 8.x..8.x compared (519fff4bc13bf..519fffaed3821):
ct : 610,847|610,847|0|0.0%
wt : 5,733,916|5,732,281|-1,635|-0.0%
cpu : 5,638,489|5,631,327|-7,162|-0.1%
mu : 58,147,712|58,147,712|0|0.0%
pmu : 58,361,520|58,361,520|0|0.0%
=== 8.x..issue-1898456 compared (519fff4bc13bf..519fffcb3a4b0):
ct : 610,847|610,847|0|0.0%
wt : 5,733,916|5,788,314|54,398|0.9%
cpu : 5,638,489|5,684,892|46,403|0.8%
mu : 58,147,712|58,149,264|1,552|0.0%
pmu : 58,361,520|58,362,504|984|0.0%
Comment #21
joelpittet#8: drupal-twig-common_test-1898456-8.patch queued for re-testing.
Comment #22
joelpittet@rwohleb could you post your scenario in the summary for testing so someone can try to reproduce your results? Also, thanks for doing those! They don't look all that bad coming from a theme to template conversion.
Comment #23
ezeedub CreditAttribution: ezeedub commentedLooks like same number of function calls in the 8.x..issue-1898456 comparison. I'll redo this one.
Comment #24
ezeedub CreditAttribution: ezeedub commentedI couldn't figure out how to hit the template.
Comment #25
star-szrI'm going to go ahead and say we don't need profiling on this because it's only used for automated testing, and set back to RTBC. Thanks for your efforts everyone :)
Comment #26
star-szr#8: drupal-twig-common_test-1898456-8.patch queued for re-testing.
Comment #27
alexpottCommitted c5cecfd and pushed to 8.x. Thanks!
Comment #28.0
(not verified) CreditAttribution: commentedRemove sandbox link