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 #1843772 by joelpittet, steveoliver, 2ndmile, Cottser | tostinni: Convert views-ui-display-tab-bucket.tpl.php to Twig.
Meta issue: #1898472: [meta] Convert views_ui module to Twig
#1987510: [meta] Convert all core *.tpl.php templates to Twig as singular patch
Manual testing steps:
1. Edit a view
2. A tab bucket is the wrapper around a set of zebra striped options with a title on the view edit page
Profiling results
=== 8.x..8.x compared (5198f0bb880ef..5198f219706e9):
ct : 61,482|61,482|0|0.0%
wt : 316,970|316,924|-46|-0.0%
cpu : 277,976|278,191|215|0.1%
mu : 16,466,872|16,466,872|0|0.0%
pmu : 16,725,408|16,725,408|0|0.0%
http://www.lionsad.de/xhprof-kit/xhprof/xhprof_html/?run1=5198f0bb880ef&...
=== 8.x..views-ui-display-tab-bucket-1843772-25 compared (5198f0bb880ef..5198f1db1bc51):
ct : 61,482|61,996|514|0.8%
wt : 316,970|318,571|1,601|0.5%
cpu : 277,976|280,193|2,217|0.8%
mu : 16,466,872|16,495,480|28,608|0.2%
pmu : 16,725,408|16,763,776|38,368|0.2%
http://www.lionsad.de/xhprof-kit/xhprof/xhprof_html/?run1=5198f0bb880ef&...
Comment | File | Size | Author |
---|---|---|---|
#25 | 1843772-25.patch | 3.02 KB | star-szr |
#20 | 1843772-20-twig-views-ui-tab-bucket.patch | 3.08 KB | joelpittet |
#20 | interdiff.txt | 780 bytes | joelpittet |
#18 | twig-views-ui-tab-bucket-1843772-18.patch | 2.85 KB | 2ndmile |
#18 | interdiff.txt | 1.69 KB | 2ndmile |
Comments
Comment #1
joelpittetfirst draft, hope I got the path correct
Comment #2
mbrett5062 CreditAttribution: mbrett5062 commentedTagging.
Comment #3
jpamental CreditAttribution: jpamental commentedApplies cleanly, works as advertised.
Comment #4
dawehnerBack to needs review due to missing documentation of variables, sorry.
Comment #5
steveoliver CreditAttribution: steveoliver commentedSwaps out .tpl.php with .html.twig, removing one call to drupal_render() in preprocess and adding comments to the template.
Comment #6
steveoliver CreditAttribution: steveoliver commentedComment #7
dawehnerThanks for helping!
Is there a reason why we reorder the variables?
Comment #8
joelpittetNo idea why I did that, usually OCD on those things. @dawehner want me to reroll that in the previous order? we can probably do just {{ attributes }} now as well because we decided that the class breakout would be examples for bartik theme.
Comment #9
joelpittetOk removed the class split out and put the actions back in there place.
Comment #10
star-szrRetitling.
Comment #11
dawehnerSorry for this nitpick: Should be "Default theme implementation ...".
Not sure whether I asked that before. What was "-" used for?
Comment #12
joelpittetDid doc updates from #11 and preprocess doc cleanup.
@dawehner: {%- and {{- are whitespace modifiers
@see http://twig.sensiolabs.org/doc/templates.html#whitespace-control
Comment #13
star-szrTagging.
Comment #14
joelpittetComment #15
dawehnerperfect! The views UI still works as expected.
Comment #16
star-szrThanks @dawehner :) tagging as a Novice task for these minor docs tweaks, then back to RTBC.
i.e should be e.g. in this case.
I think we've been capitalizing Views and Views UI.
If '#actions' is a render element, the default should be array() instead of an empty string.
Comment #17
2ndmile CreditAttribution: 2ndmile commentedI will take it.
Comment #18
2ndmile CreditAttribution: 2ndmile commentedChanges from #16 implemented. Please review.
Comment #19
star-szrLooks good, thanks @2ndmile!
Comment #20
joelpittetFixing attribute title for overridden display tab buckets.
Comment #21
joelpittetfix for #20 at #1484704: Remove instances of attributes_array needs re-roll once that get in.
Comment #22
Fabianx CreditAttribution: Fabianx commented#20: 1843772-20-twig-views-ui-tab-bucket.patch queued for re-testing.
Comment #24
star-szrI'm on it.
Comment #25
star-szrRerolled. The Views UI module got moved to core/modules in #1820414: CHANGE NOTICE: Move views_ui.module directly into /core/modules/.
Comment #25.0
star-szrUpdate to point to right meta issue
Comment #26
star-szrTagging for profiling.
Comment #27
thedavidmeister CreditAttribution: thedavidmeister commentedI don't think this ever got tested properly. Patch looks good from a code standards POV though.
Comment #28
thedavidmeister CreditAttribution: thedavidmeister commentedtesting
Comment #29
thedavidmeister CreditAttribution: thedavidmeister commentedah, a "tab bucket" is a zebra striped collection of settings with a title on the view edit page.
Comment #29.0
thedavidmeister CreditAttribution: thedavidmeister commentedUpdated issue summary.
Comment #30
thedavidmeister CreditAttribution: thedavidmeister commentedHEAD:
post-patch:
diff:
Twig conversion fixes a double space in the wrapper div and everything else is identical. Setting back to RTBC.
Comment #31
star-szrDibs on this for profiling.
Comment #32
star-szrProfiling results for editing frontpage view:
/admin/structure/views/view/frontpage/edit
http://www.lionsad.de/xhprof-kit/xhprof/xhprof_html/?run1=5198f0bb880ef&...
http://www.lionsad.de/xhprof-kit/xhprof/xhprof_html/?run1=5198f0bb880ef&...
Comment #32.0
star-szrupdated issue summary
Comment #33
alexpott+1. Ready for #1987510: [meta] Convert all core *.tpl.php templates to Twig as singular patch
Comment #33.0
alexpottAdd profiling results
Comment #34
alexpottCommitted 298d1fd and pushed to 8.x. Thanks!
Comment #35.0
(not verified) CreditAttribution: commentedUpdated issue summary -- add git commit message.