Tagging VDC because and Twig because this is where the discussion came from. Most of which came from Views but this is all over other components as well.

Problem/Motivation

Variable clean-up for consistency.

Proposed resolution

Convert all $vars to $variables.
Wait till the twig conversions get committed to core, then convert all modules below as one patch:

Language
core/lib/Drupal/Core/Language/Language.php

Color
core/modules/color/color.module

Link
core/modules/link/link.module

Node
core/modules/node/node.views.inc

Views
core/modules/views/views.module
core/modules/views/views.theme.inc

Views UI
core/modules/views/views_ui/views_ui.module
core/modules/views/views_ui/views_ui.theme.inc

Seven
core/themes/seven/template.php

#1843738: [meta] Convert views module to Twig
#1757550: [Meta] Convert core theme functions to Twig templates

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joelpittet’s picture

Issue tags: +theme system cleanup
joelpittet’s picture

Issue tags: -clean system cleanup
joelpittet’s picture

Issue tags: +code consistency
joelpittet’s picture

Status: Postponed » Needs review

Running test... turning to posponed after.

joelpittet’s picture

Title: Change all instances of $vars to $variables » [meta] Change all instances of $vars to $variables
joelpittet’s picture

Issue tags: +Novice

Converting this to meta as per @dawehner: Each of these modules needs it's own issue.

Language
core/lib/Drupal/Core/Language/Language.php

Color
core/modules/color/color.module

Link
core/modules/link/link.module

Node
core/modules/node/node.views.inc

Views
core/modules/views/views.module
core/modules/views/views.theme.inc

Views UI
core/modules/views/views_ui/views_ui.module
core/modules/views/views_ui/views_ui.theme.inc

Seven
core/themes/seven/template.php

Also, my patch is garbage, it's including core/vendor. Please don't use:)

thedavidmeister’s picture

Status: Needs review » Postponed

This is flagged as an "after commit" issue for #1757550: [Meta] Convert core theme functions to Twig templates so I'll just postpone this for now as this patch will need to be rerolled once all the Twig conversions land anyway.

webchick’s picture

Note that if this is literally just a find/replace of vars -> variables, we don't need separate issues for all of the affected files. It's trivial to glance through the patch (even if it is quite big) and verify that the same changes are made everywhere, and we didn't accidentally change something like "varsity" into "variablesity". :)

Individual template file => Twig conversions do make sense as separate issues, because often there is markup clean-up / docs tweaks at the same time, which would be difficult to review in amongst 50,000 other changes.

star-szr’s picture

Agreed.

ACF’s picture

Status: Postponed » Needs review
FileSize
81.64 KB

Done a careful find and replace and changed all the vars to variables

thedavidmeister’s picture

#10 - you're either going to have to re-roll that at some point or a bunch of issues #1757550: [Meta] Convert core theme functions to Twig templates will need re-rolling. I'm not sure which is preferable.

webchick’s picture

Yeah... I'd rather we postpone this one, since it's much easier to re-roll and requires far less coordination.

star-szr’s picture

Status: Needs review » Postponed

Yup, this should be postponed. Thanks @ACF!

joelpittet’s picture

Status: Postponed » Needs review
Issue tags: +Quick fix

I don't think this needs postponing, I separated it to get the cleanup in a bit faster. I don't mind re-rolling those mostly(if not all) views patches, as I have already un-rolled them to remove the $vars => $variables to unmuddy their patches on some.

Also, thank you @ACF for going through that:)

star-szr’s picture

Status: Needs review » Postponed

I think we must postpone this task. This cleanup will only slow down the Twig conversion and we simply cannot afford that unless our contributor base expands significantly overnight. It's also not preventing D8 from shipping, and is the very definition of 'minor'.

johnshortess’s picture

Title: [meta] Change all instances of $vars to $variables » Change all instances of $vars to $variables

Per @jenlampton (in the sprint just now) and @webchick in #8, removing [meta], so we can reroll one patch after #1757550.

johnshortess’s picture

Issue summary: View changes

Added files that need issues.

joelpittet’s picture

Priority: Minor » Normal
Status: Postponed » Needs review
FileSize
60.47 KB

Re-rolled from #10 without the vendor changes and unposponed due to twig templates being committed.

dasjo’s picture

here's a reroll + interdiff.
theme_views_ui_reorder_displays_form seems to be gone.

the patch looks pretty straight forward to me.

dasjo’s picture

i went through the patch using git diff --color-words and it seems perfectly fine.

besides the vendor folder, there are no more uses of var. if tests pass again for the reroll, i'd recommend RTBCing this one :)

Fabianx’s picture

Status: Needs review » Reviewed & tested by the community

This looks good to me, passes tests, has been pre-RTBCed by #19. => RTBC

joelpittet’s picture

Issue tags: -Novice

Thank you @dasjo. The interdiff is a bit funky on #18 different patch format?

Removing novice tag.

RTBC++

star-szr’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Quick fix, +clean-up, +Twig, +theme system cleanup, +VDC, +code consistency

The last submitted patch, 1963942-18-vars-to-variables.patch, failed testing.

joelpittet’s picture

Status: Needs work » Needs review
FileSize
60.05 KB

Head's moving, I caught it again.

Status: Needs review » Needs work
Issue tags: -Quick fix, -clean-up, -Twig, -theme system cleanup, -VDC, -code consistency

The last submitted patch, 1963942-24-vars-to-variables.patch, failed testing.

joelpittet’s picture

Status: Needs work » Needs review
Issue tags: +Quick fix, +clean-up, +Twig, +theme system cleanup, +VDC, +code consistency

#24: 1963942-24-vars-to-variables.patch queued for re-testing.

joelpittet’s picture

Moving target...

Fabianx’s picture

Status: Needs review » Reviewed & tested by the community

This looks good again:

"This looks good to me, passes tests, has been pre-RTBCed by #19. => RTBC"

star-szr’s picture

Status: Reviewed & tested by the community » Needs work

No longer applies.

joelpittet’s picture

Status: Needs work » Needs review
FileSize
58.13 KB

Re-rolled, if this is green it's back to RTBC;)

star-szr’s picture

Status: Needs review » Reviewed & tested by the community

Re-reviewed with git diff --color-words, patch looks good. Replaces all instances of $vars from core and leaves core/vendor alone.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.x, thanks!

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

Anonymous’s picture

Issue summary: View changes

Updated proposed resolution to indicate we are updating all modules in this issue, rather than creating issues for each.