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.
Comment | File | Size | Author |
---|---|---|---|
#41 | drupal_2039435_41-interdiff.txt | 724 bytes | Berdir |
#41 | drupal_2039435_41.patch | 24.28 KB | Berdir |
#33 | drupal_2039435_33.patch | 23.43 KB | Berdir |
Comments
Comment #1
BerdirThis one will be a bit more complicated, as we need to re-introduce support for cache tags.
Comment #2
amateescu CreditAttribution: amateescu commentedMaybe we should wait to see the fate of #2005716: Promote EntityType to a domain object?
Comment #3
BerdirI started doing this in #2201879: Rename InfoHookDecorator to BuildHookDecorator.
Fixed EntityManagerTest (that thing is *so* complex) and addressed dawehner's review from over there.
> Given that the info hook decorator is cached I think we should just use it.
I don't understand this. Note that my patch does not use the info hook decorator at all anymore.
- Added the link to the related issue, didn't know that existed.
Comment #4
BerdirRe-roll, updated the mocked cache methods.
Comment #5
tim.plunkettI think these two should be switched. That's how it is now, and we would still want to process anything being added...
Heh, nice
The rest looks good.
Comment #6
Berdir1. Yes, true, not sure why I added that there. I also added the optional check thingy, another thing that is not compatible with objects btw, would have exploded if wouldn't have overridden the findDefinitions() method anyway...
Comment #8
BerdirHa, nice, tricked myself out :)
Well, at least that part is then tested too ;)
Comment #9
BerdirStill applies, looking for reviews :)
Comment #10
Berdir#2168159: Plugin Derivatives don't work with Objects returned from Annotations landed, so the @todo can be removed, also added the same array casting to the base findDefinitions() implementation.
That means we now also have support for entity type derivatives ;)
Comment #11
tim.plunkettHeh
Why add this? I see its basically copied from DefaultPluginManager, but do we need this?
Hm, it's a shame it's too late to use AnnotationInterface::getProvider() here
Comment #12
Berdir1. Ups :)
2. Yeah, I guess providing an entity type for a different module doesn't make much sense, valid point ;) Removed.
Comment #13
tim.plunkettLooks good, thanks
Comment #14
Berdir12: entity-default-plugin-manager-2039435-12.patch queued for re-testing.
Comment #16
XanoComment #18
XanoComment #19
BerdirRe-roll look good, thanks.
Comment #21
Xano18: drupal_2039435_18.patch queued for re-testing.
Comment #22
XanoRTBC, under the condition that the tests pass.
Comment #24
XanoComment #25
XanoComment #26
Berdir24: drupal_2039435_24.patch queued for re-testing.
Comment #28
BerdirRe-roll and fixing new unit tests...
Comment #29
dawehnerIs there a reason we can't just do invokeAll?
Is there a way to also extend the test coverage for DefaultPluginManager?
Just to be sure: We switch to the default plugin manager, so we don't longer use the cache decorator?
Can we also set the parameters for set, maybe just the name of the cid?
Comment #30
BerdirThanks for the review.
1. I copied that from the existing implementation, the reason is that we can pass it to the hook by reference, it's build, so we should allow adding more of them, especially since derivatives won't work for entities (we can't have entity types that contain :).
2. Yeah there is, also proved that it wasn't actually working yet..
3. Yeah, due to that change, we have a lot more calls to the mocked cache backend that we need to care about, so that's causing all those test changes.
4. Did that.
Comment #31
Wim LeersI can only find nitpicks, but I'm no expert in this area.
Why this when you could use
ModuleHandler::invoke()
?Wowza. Could we maybe do the array check/cast first, do a
continue
if it fails, and then do the rest? That'd be a lot more legible.Comment #32
BerdirThanks for the review, for 1., I don't think that works properly with by-reference arguments, which is what we need here? If it would, we could also just use invokeAll() directly...
And yes, that condition there is crazy, I copied that as a pattern from a related issue that did something similar for derivatives, 1+ to splitting that it up, will do that asap.
Comment #33
BerdirThis is easier to understand I think...
Comment #34
Wim LeersYes, thanks :)
Comment #36
Xano33: drupal_2039435_33.patch queued for re-testing.
Comment #37
XanoComment #38
BerdirLooks like the last test run did pass?
Comment #40
catch$function
This at least needs a comment as to why it's not using invokeAll().
Also wonder if we shouldn't add an invokeAllByRef() that's basically the same as alter() except without changing the hook name?
Comment #41
BerdirThis enough?
This code is copied 1:1 from InfoHookDecorator, I'm worried that introducing such a method would result in discussions about naming and numbers of argument and stuff and I'd love to get this in as this is the last standard plugin manager not extending from the DefaultPluginManager.
Can we look at that in a follow-up issue?
Comment #42
tim.plunkettReviewed this again, looks great. Thanks @Berdir!
Comment #43
webchickThis looks like great clean-up, rock.
Committed and pushed to 8.x. Thanks!