Closed (duplicate)
Project:
Drupal core
Version:
9.0.x-dev
Component:
theme system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
29 Apr 2013 at 00:10 UTC
Updated:
11 Oct 2016 at 14:19 UTC
Jump to comment: Most recent
Comments
Comment #0.0
star-szrAdd more issues
Comment #0.1
star-szrUpdated issue summary.
Comment #1
c4rl commentedPer #1938430-18: Don't add a default theme hook class in template_preprocess(), my original intention of that issue was to remove template_preprocess() entirely, and I would still like that to happen.
Frankly, I think #1982024: Lazy-load Attribute objects later in the rendering process only if needed perpetuates an anti-pattern. What do we gain by assuming every template contains `attributes,` `title_attributes,` and `content_attributes` whilst any other presence of another Attribute object in a template would require invocation anyway via `new Attribute` in a subsequent preprocessor?
Really, I'm curious of what would be wrong with invoking `new Attribute` on a case-by-case basis. I think assuming that every templates wants these goes some of the Principles we established at BADCamp 2012.
Comment #1.0
c4rl commentedUpdated issue summary.
Comment #2
joelpittetI agree with @c4rl in #1 entirely. Though undoing that "anti-pattern" is harder than it sounds due to the prevalence of
NestedArray::mergeDeepArray. I got half way there with this issue #2108771: Remove special cased title_attributes and content_attributes for Attribute creation.And regarding removing template_preprocess(). It will need to be done delicately so we don't break things but that would be a nice thing to do as well:)
Comment #3
jiv_e commentedComment #4
jiv_e commentedComment #5
joelpittetLikely 9.x
Comment #6
catch#2340341: Move template_preprocess, _template_preprocess_default_variables into services is the only remaining issue from the summary, and is in progress against 8.3.x, so closing this.