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.
Updated: Comment #N
Problem/Motivation
We want to clear out common.inc,
Proposed resolution
so lets' move element_info() into some simple service.
Remaining tasks
User interface changes
API changes
@TODO
Comment | File | Size | Author |
---|---|---|---|
#27 | element_info-2207743-27.patch | 11.58 KB | dawehner |
#22 | drupal_2207743_22.patch | 11.72 KB | Xano |
#1 | element-2207743-1.patch | 3.81 KB | dawehner |
Comments
Comment #1
dawehner.
Comment #2
damiankloip CreditAttribution: damiankloip commentedI'm wondering if this should live in the Drupal\Core\Render namespace or something instead?
meh
Comment #3
dawehnerQuite meh.
Good idea!
Also write a basic unit test.
Comment #5
damiankloip CreditAttribution: damiankloip commentedI guess that is strictly true, seems weird to have @covers for a non-test method though.
Oh, I am sorry. HA
Comment #6
dawehnerTrue, it is a bit sad as it is the only way to get a 100% test coverage now.
Don't you get this behavior in your storm instance?
Comment #7
ParisLiakos CreditAttribution: ParisLiakos commentedthis is a lie:P
i guess it would be nice to have an interface:)
oh, thats nice trick!
Comment #8
dawehnerSure, here is a patch.
Comment #9
XanoMostly docs fixes, and ElementInfo::buildInfo() is now purer by returning the info rather than setting it itself. Might make it more reusable in the future, and more easily testable.
Comment #10
damiankloip CreditAttribution: damiankloip commentedIf we are deprecating it, don't we need an issue (novice) for removing that to reference here?
Full namespace needed.
Nice coverage.
Comment #11
XanoWill do.
Comment #13
XanoI talked to Wim Leers about the idea of renaming this to a generic
render
service, where we can potentially move code likedrupal_render()
andElement::children()
as well, because a service with one method is silly and all these things belong to the same render API. What do you think?Comment #14
Eric_A CreditAttribution: Eric_A commented11: drupal_2207743_11.patch queued for re-testing.
Comment #15
dawehnerIt is clear that will need something like a service for drupal_render at the end, but this should be just be responsible for doing the drupal_render logic. On top of that you have services which gives you the element information. I kinda hate to merge a bunch of connected but orthogonal responsiblities.
Comment #16
XanoDoesn't look like this needs work at all.
Comment #17
dawehnerYeah I also disagree with the testbot.
Comment #19
dawehnerRerolled.
Comment #20
XanoComment #22
XanoRe-roll.
Comment #23
XanoRTBC if tests pass.
Comment #24
alexpott@todo for an issue summary :) therefore needs work
Comment #25
dawehnerUpdated issue summary and a link to the change notice: https://drupal.org/node/2235461
Comment #27
dawehnerReroll
Comment #28
sunAwesome!
Comment #29
dawehner.
Comment #30
xjmThanks for the change record draft!
Comment #31
alexpottCommitted d196e8f and pushed to 8.x. Thanks!