Closed (fixed)
Project:
Drupal 7 to Modern Drupal Module Upgrader
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
2 Aug 2024 at 15:50 UTC
Updated:
19 Mar 2026 at 07:10 UTC
Jump to comment: Most recent
Comments
Comment #3
andyf commentedI don't know the module or pharborist at all, but I'm expecting to have a D7 upgrade project soon and thought I'd try and help push things forward a little.
The test error seems to be legit, I get it locally.
As far as I can tell it's down to
\Drupal\drupalmoduleupgrader\Plugin\DMU\Fixer\Delete::execute()calling\Drupal\drupalmoduleupgrader\Plugin\DMU\Fixer\NodeCollectorTrait::getObjects()and getting back a\Pharborist\Noderather than a\Pharborist\NodeCollection. That in turn seems to be down to\Drupal\drupalmoduleupgrader\IndexerInterface::get()returning aNodeCollectionwith some indexers and an individualNodewith others (at least with\Drupal\drupalmoduleupgrader\Plugin\DMU\Indexer\Functions::get()).All usages of
getObjects()immediately iterate the result, so it feels like it could be corrected by ensuring we return aNodeCollection. However I don't see how it was ever working, I don't see any obvious changes in the affected code that caused it to start failing, and if I revert the module back to 1.9 (and use the version ofjcnventura/pharboristfrom the same date) I still get the same failure, so I'm nervous I'm missing something here. Also annoyingly I don't know how to get the module to use the delete plugin outside of a test, so I can't do a manual functional test and verify there definitely is an issue with the delete plugin, and it's fixed with the change. I don't see any issues in the queue that might be related.Comment #4
andyf commentedI've added the possible solution suggested in the previous comment of ensuring we always return a node collection; as mentioned before I don't know how to test it properly with the module and I'm new to it, so careful review appreciated, thanks!
Comment #6
gábor hojtsy