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.
It seems the RenderedItem
processor currently doesn't properly declare the view modes it uses as dependencies, and I guess it should?
Comment | File | Size | Author |
---|---|---|---|
#5 | 2573997-5--rendered_item_processor_dependencies.patch | 1.49 KB | drunken monkey |
|
Comments
Comment #2
borisson_Attached is a patch that should implement this; it doesn't work and the test is based on the patch in #2574633: Properly react when a plugin's dependencies are removed.
The attached .txt file is an interdiff to that other issue.
Comment #4
borisson_Still based on #2574633: Properly react when a plugin's dependencies are removed.
interdiff is towards that issue, no inderdiff to the previous patch though.
Comment #5
drunken monkeyThe patch in #4 doesn't seem to actually contain the
RenderedItem
changes anymore. Which is probably why the tests pass – I otherwise don't think the code would correctly handle removed plugin dependencies, as explained in the other issues.So, I think we should just leave the tests out for now and take care of all that in #2574633: Properly react when a plugin's dependencies are removed.
Regarding the actual code:
It's not
$entity
, it's$datasource_id
– which is actually a pretty important difference. The current code will fail for any datasource that is not one of our ownContentEntity
datasources.What advantage does this have over just calling
addDependency()
here?However, more importantly, you're passing an object to
addDependency()
where a config dependency name is expected. I'm pretty sure you need to call$evm->getConfigDependencyName()
there.The attached patch would fix both of these issues, I think, and would be RTBC from my point of view (unless I've made a mistake in there). Testing dependency removal and making sure all processors declare appropriate dependencies would be two separate issues, I'd say (since this needs to happen for other processors, too).
Comment #6
borisson_Comment #7
drunken monkeyAll right, we're on a roll here … !
Committed.
Thanks again!