Closed (fixed)
Project:
Project Browser
Version:
2.1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
20 Jun 2025 at 14:57 UTC
Updated:
9 Jul 2025 at 17:34 UTC
Jump to comment: Most recent
Drupal 11.2 has full support for object-oriented hooks, so maybe it's time Project Browser adopt them in its 2.1.x branch (not in 2.0.x, since that needs to maintain wide pre-11.2 compatibility).
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
phenaproximaComment #4
tim.plunkettNice work! Verified that the `initial preprocess` approach is the standard practice
Comment #7
chrisfromredfin11.2-only feature so no backport needed.
Comment #8
nicxvan commentedPretty sure the template preprocess needs only one `:` for the method, that's how @berdir has been doing it in conversions for core.
https://git.drupalcode.org/project/drupal/-/merge_requests/11807/diffs#f...
I had asked about it and since it's not a service a single is the way to do it.
Further, it doesn't hurt, but the empty post update hooks shouldn't be necessary either.
Comment #9
tim.plunkettThat's actually backwards, the two syntaxes are
service:methodandclass::method. However, the code in CallableResolver has identical code paths after exploding on either amount of :, it processes them the same by passing onto ClassResolver::getInstanceFromDefinition()Either way, it will work.
Comment #10
nicxvan commentedThanks!