Problem/Motivation

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).

Command icon Show commands

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

phenaproxima created an issue. See original summary.

phenaproxima’s picture

Status: Active » Needs review
tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

Nice work! Verified that the `initial preprocess` approach is the standard practice

chrisfromredfin made their first commit to this issue’s fork.

chrisfromredfin’s picture

Status: Reviewed & tested by the community » Fixed

11.2-only feature so no backport needed.

nicxvan’s picture

Pretty 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.

tim.plunkett’s picture

That's actually backwards, the two syntaxes are service:method and class::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.

nicxvan’s picture

Thanks!

Status: Fixed » Closed (fixed)

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