Closed (fixed)
Project:
Migrate Boost
Version:
2.0.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
13 Jan 2025 at 03:45 UTC
Updated:
16 May 2025 at 18:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
nicxvan commentedComment #4
ressaComment #5
ressaMoving some description here, from duplicate issue.
Comment #6
joelpittetCurrent code produces this error. I tried uninstalling and pre patch, and installing with patch with the same result.
Comment #7
nicxvan commentedWhat version of drupal?
Comment #8
joelpittetSame in the title, drupal 10 and drush 13
Comment #9
joelpittetSorry, I applied it against 1.x, disregard my comment
Comment #10
joelpittetI saw the same problem in 2.x
Comment #11
joelpittetThe MR still has this alter() static method call which doesn't exist any more:
What's the plan for this?
Comment #12
joelpittetMigrateBoost::isBoostActive()seems to be always not set. And the drush command doesn't seem to be available.I think the command is missing a services yaml like:
and I think the namespace for the command should be
namespace Drupal\migrate_boost\Commands;instead ofnamespace Drupal\migrate_boost\Drush\Commands;Thoughts?
Comment #13
joelpittetRE #11, this is the error, I didn't make a commit because I don't have an idea what is supposed to happen with that, I suspect remove
migrate_boost_module_implements_alter?Comment #14
joelpittetRe #12, based on the Issue Summary goal of “let’s also remove the dependency on Drush,” I’m assuming we can remove the command entirely.
Since we are decorating the module handler, we also don’t need
migrate_boost_module_implements_alter().I’ll go ahead and remove them as I’m just trying to get this working. Let me know if I’ve overstepped in my haste!
Comment #15
nicxvan commentedNo worries! HMIA does need to be removed, I don't recall if we need Drush still, I think it hooks into only affect migrations run with Drush.
Happy to have someone reviewing, I only work on this for a personal project so I've not had time to dig in further.
Comment #16
joelpittetThanks @nicxvan, I am not sure what HMIA is, I am guessing it's related to inheritance or something but google/ChatGPT didn't turn up good results.
Comment #17
nicxvan commentedhook_module_implements_alter == HMIA
Comment #18
joelpittetAh a Drupal acronym I've never heard of, thanks!
Comment #19
joelpittetOk this is working for me now. My last commit got rid of
isHookDisabled()calls without the new $module arg because it wasn't available without implementinggetImplementationInfo()andbuildImplementationInfo()andverifyImplementations()which isn't the end of the world but getting pretty complicated and likely not needed.The
altermethods are tricky, because they call some of the decorated methods inside themselves. It’s almost better to just leave them alone.Comment #20
nicxvan commentedThis looks great!
Gonna test it some now.
Comment #21
nicxvan commentedI think I can get behind dropping the ability to kill alter, but I think we need to handle invokeAllWith still.
Gonna work on this a bit.
Comment #22
nicxvan commentedWhat do you think of that?
Thanks for all of your help!
Comment #23
joelpittetThanks for the review!
I’ll look at it tomorrow when I am in.
Comment #24
joelpittet@nicxvan I had a look, trying it out IRL right now. The code looks good to me, going to mark this RTBC from my end as it does what is on the Tin ;)
Comment #25
grevil commentedProviding static patch for the time being.
Comment #26
grevil commentedSeems to work great! Currently, in the midst of migrating a large Drupal 6 site. If anything goes wrong related to this module, I'll comment here again!
Note, that the introduction of the new Decorator leads to an error when migrating d6 nodes. But that is unrelated to this module but rather a drupal core issue. I just created an issue + fix here: #3512815: "core/modules/node/src/Plugin/migrate/source/d6/Node.php" "__construct" method uses variable of type "ModuleHandler" instead of "ModuleHandlerInterface".
Otherwise, RTBC +1!
Comment #27
anybodyConfirming #26!
Comment #28
grevil commentedFYI, #3512815: "core/modules/node/src/Plugin/migrate/source/d6/Node.php" "__construct" method uses variable of type "ModuleHandler" instead of "ModuleHandlerInterface" was merged into core! So there is nothing holding back this issue!
Comment #29
nicxvan commentedThanks everyone, this is on my list!
Comment #30
nicxvan commentedThank you everyone, I'm merging this, I did restrict this to 11.1 and above since this will only work there.
This version will be very short lived since ModuleHandler is refactored in 11.2. but we can cross that bridge when we get there.
Comment #32
nicxvan commentedComment #33
joelpittetAw man I was using this on Drupal 10 🥺
Comment #34
nicxvan commentedSorry about that, but I don't see how this could have possibly worked on Drupal 10, Hooks are not events in Drupal 11 which this decoration assumes.
If you want to open another issue to add it back in I can reevaluate there.
Comment #35
joelpittetI am quite sure I got this working in 10.x, but I put some time into making it work (whole time above was testing against 10.x ^^). Can I use #3520832: Consider adding Drupal 10 support back to version 2 as my other issue?
Comment #36
nicxvan commentedYes, I created that one for you to test with. That reverts the only change I made in this issue after your work.