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
Twig sandbox: http://drupal.org/sandbox/pixelmord/1750250
- Replace all tpl.php files with .html.twig equivalents
- Replace all theme functions with .html.twig equivalent templates
- Add new preprocess functions for the .html.twig equivalent templates
- Update all hook_theme definitions
Remaining
Template files:
- #1843772: Convert views/views_ui/templates/views-ui-display-tab-bucket.tpl.php to Twig
- #1843774: Convert views/views_ui/templates/views-ui-display-tab-setting.tpl.php to Twig
Theme functions:
- #1963978: Convert theme_views_ui_build_group_filter_form() to Twig
- #1915026: Convert theme_views_ui_container to Twig
- #1963980: Convert theme_views_ui_expose_filter_form() to Twig
- #1963982: Convert theme_views_ui_rearrange_filter_form() to Twig
- #1918648: Convert theme_views_ui_style_plugin_table to Twig
- #1963986: Convert theme_views_ui_view_info() to Twig
- #1963988: Convert theme_views_ui_view_preview_section() to Twig
Related Issues
#1843738: [meta] Convert views module to Twig
#1757550: [Meta] Convert core theme functions to Twig templates
Comment | File | Size | Author |
---|---|---|---|
#13 | twig-views-ui-1898472-13.patch | 47.17 KB | joelpittet |
#13 | interdiff.txt | 10.72 KB | joelpittet |
#9 | 1898472-9-twig-views-ui.patch | 46.89 KB | duellj |
#9 | interdiff.txt | 8.31 KB | duellj |
#7 | drupal-twig-views-ui-1898472-7.patch | 46.14 KB | joelpittet |
Comments
Comment #1
c4rl CreditAttribution: c4rl commentedTagging
Comment #2
tim.plunkettTagging.
Comment #3
joelpittetComment #4
joelpittetFirst run at this one, could use a hand with a re-roll for the @todos in the preprocessors and twig templates. Also a general review would be nice as well.
all the unset()'s were are to mimic what drupal_render does by removing form elements as they are rendered
added @todo Refactor when http://drupal.org/node/1920886 is resolved.
Comment #5
joelpittetthat one will fail, this little guy will hopefully fix it.
Comment #7
joelpittetAdded some checks for all those widget, value, etc missing references...
Comment #9
duellj CreditAttribution: duellj commentedOk, I think I fixed most of the failing tests. One of the problems was that columns that are render arrays need to placed in 'data' keys. I also changed some hardcoded links to render arrays.
This should be set back to needs work after testbot checks it out, since there's still some doc updates that need to happen.
Comment #11
duellj CreditAttribution: duellj commented#9: 1898472-9-twig-views-ui.patch queued for re-testing.
Comment #12
joelpittetThanks a bunch @duellj I didn't think I would need to have to change those other table cell fields as well. And thanks for the link conversions too!
Needs docblock review and cleanup
Comment #13
joelpittet@duellj, fixed a typo of
'#theme' => '#link'
and a left over dpm().Also, did some of the doc todos.
Could use a hand finishing off the doc @todos
Comment #14
damiankloip CreditAttribution: damiankloip commentedI'm not being funny, but we didn't say we wanted separate issues for all of these? or was that for the actual templates, I'm not sure.
Anyway, see #1929064: [Change notice] Refactor views_ui_rearrange_form to remove theme function for table render, as this will affect this a little. We will be removing some stuff there.
Comment #15
star-szr@damiankloip - we could certainly split this up, please let us know what you'd like us to do; we're trying to get all of core converted by mid-April :)
Comment #16
star-szrLooks like we already have some sub-issues here (two that migrated from the Twig sandbox), so I guess I'm leaning towards splitting this up:
#1843774: Convert views/views_ui/templates/views-ui-display-tab-setting.tpl.php to Twig
#1843772: Convert views/views_ui/templates/views-ui-display-tab-bucket.tpl.php to Twig
#1918648: Convert theme_views_ui_style_plugin_table to Twig
Also if I'm not mistaken these two declarations can be removed from views_ui_theme(), I don't see them used anywhere:
theme_views_tabset()
theme_views_tab()
Comment #17
star-szrFound one more, I think we should just split the patch up and make this issue a meta.
#1915026: Convert theme_views_ui_container to Twig
Comment #18
dawehner@Cottser
You are absolute right, this is from D6, though I remember that I had opened an issue for it. If you don't find it, don't mind fill your own.
Comment #20
star-szrOkay, this is a meta now. @joelpittet said he could split up the patch and add to the sub-issues.
Comment #20.0
star-szrConverting to meta issue
Comment #20.1
star-szrListifying
Comment #20.2
star-szrUpdate for theme_views_ui_rearrange_form()
Comment #20.3
joelpittetre-order
Comment #21
star-szrAs discussed with @dawehner we will remove
@ingroup views_templates
from all Views and Views UI .html.twig templates. If you are working on patches on any of the sub-issues that have this line in the template(s) it would be a huge help if you can reroll to remove that line. Thanks!Comment #21.0
star-szrRemove theme_views_tabset()
Comment #21.1
star-szrRemove issues that are no longer Twig conversions (cleanup, #type table conversions, etc)
Comment #22
joelpittetComment #22.0
joelpittetAdd assignment dealie (@ signs)