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.
Issue #2152203 by steveoliver, joelpittet, hussainweb, shanethehat, jenlampton, kpa, AnythonyR, EVIIILJ, kgoel, Cottser, dsdeiz, hanpersand: Convert theme_container() to Twig
Task
Convert theme_container() to a Twig template.
Remaining tasks
- Patch
- Patch review
- Manual testing
- Profiling
Steps to test
- Turn on twig debug in your settings.php
- Visit /admin/structure/views/view/content
- compare the HTML source before and after applying the patch.
- Remember to rebuild the cache before and after applying the patch.
Comment | File | Size | Author |
---|---|---|---|
#28 | 2152203-theme_container-28.patch | 6.91 KB | joelpittet |
#28 | interdiff.txt | 1.67 KB | joelpittet |
#21 | 2152203-theme_container-21.patch | 5.7 KB | joelpittet |
#21 | interdiff.txt | 803 bytes | joelpittet |
#17 | container-patched_txt___container-unpatched_txt.png | 322.74 KB | joelpittet |
Comments
Comment #1
star-szrAdding a commit message to the issue summary so the folks who already worked on #1898480: [meta] form.inc - Convert theme_ functions to Twig and in the Twig sandbox get credit.
Comment #2
joelpittetSplit from form.inc twig conversion.
Comment #4
rteijeiro CreditAttribution: rteijeiro commentedFixed following issues:
Missing semicolon.
Removed extra comma.
Removed extra comma.
Removed extra comma.
Comment #5
rteijeiro CreditAttribution: rteijeiro commentedLet see what says the testbot
Comment #8
joelpittet@rteijeiro thank you for the patch, that looks much better... I must have had my fingers on the wrong keys or something.
Comment #9
joelpittetFixing whitespace in tests.
Comment #10
joelpittetComment #11
jlbellido9: 2152203-8-theme_container.patch queued for re-testing.
Comment #12
InternetDevels CreditAttribution: InternetDevels commentedFixed comments standards.
Comment #13
star-szrThose changes are really out of scope here, almost doubled the patch size. Adding unrelated changes like that makes patches harder to review and harder to reroll. I know it feels good to clean things up, but please create a separate issue (with a priority of minor) to correct coding standards issues :)
Comment #14
joelpittet@InternetDevels Could you make a Document cleanup followup patch with the tags: Documentation and Quick Fix? For the interdiff changes?
Comment #15
star-szrComment #16
star-szrCase in point: #12 no longer applies but #9 still does. @InternetDevels it would be great if you could create the small follow-up issue if you don't mind :)
Comment #17
joelpittetUsing number #9 but with that extra space removed.
Reviewed the markup in /admin/structure/views/view/content which seemed to use it a lot (25 times).
Attached is the markup from that page before and after the patch with twig debug turned on. As well as a diff screenshot.
Comment #18
joelpittetScenario:
http://www.lionsad.de/xhprof-kit/xhprof/xhprof_html/?run1=530ad1a439784&...
http://www.lionsad.de/xhprof-kit/xhprof/xhprof_html/?run1=530ad1a439784&...
Comment #19
star-szrThanks @joelpittet for that big push forward!
I think we should keep the "Used for grouped form items…" docs here. Tagging Novice to add those docs back and upload a new patch and interdiff.
Otherwise this is looking very good, profiling included!
Comment #20
star-szrhttps://drupal.org/node/1354#themepreprocess are the documentation standards for preprocess functions.
Comment #21
joelpittetHow about we move that to the twig template like so?
Comment #22
star-szrYep that sounds like a better idea to me, thanks!
Comment #24
joelpittetWhoa ghost in the machine much. Back to RTBC!
Comment #25
joelpittet21: 2152203-theme_container-21.patch queued for re-testing.
Comment #28
joelpittetOh some more tests needed whitespace help.
Comment #29
webchickCommitted and pushed to 8.x. Thanks!