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.
Problem/Motivation
We have the #post_render_cache callback as a static mehtod in NodeViewBuilder::renderLinks.
Proposed resolution
We should move this static method into a service, like the comment module is doing it.
We should have a node.post_render_cache service and a node.link_builder service also.
Remaining tasks
- create node.post_render_cache service
- create node.link_builder service
- change the post_render_cache_service callback to call the new service
User interface changes
-
API changes
post_render_cache callback for node will be a service instead of a static method.
Comment | File | Size | Author |
---|---|---|---|
#1 | move_static_methods_to_services-2353377-1.patch | 10.36 KB | skipyT |
Comments
Comment #1
skipyT CreditAttribution: skipyT commentedDone
Comment #2
Wim LeersI see some benefit in having a
NodeLinkBuilder
service, because that's fairly likely to be overridden. The other service, I'm not convinced of at all.is not a very good argument IMHO.
Reviewed only the service that I do think is valuable:
We'll want to fix this.
Broken doxygen.
\n
after the doxygen.Methods should have a preceding and succeeding
\n
. Also missing docs on the interface.