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.
Problem/Motivation
The process plugin link_uri is in namespace Drupal\menu_link_content\Plugin\migrate\process\d6 but it is used in menu_links.yml, which is tagged for both Drupal 6 and Drupal 7.
Proposed resolution
Move LinkUri.php to Drupal\menu_link_content\Plugin\migrate\process.
Move LinkUriTest.php to Drupal\Tests\menu_link_content\Unit\Plugin\migrate\process.
Remaining tasks
Make a patch.
User interface changes
None
API changes
None
Data model changes
None
Comment | File | Size | Author |
---|---|---|---|
#26 | interdiff-2816857-24-26.txt | 904 bytes | hardikpandya |
#26 | 2816857-26.patch | 15.45 KB | hardikpandya |
#24 | process_plugin_link_uri-2816857-24.patch | 8.02 KB | heddn |
#20 | interdiff-18-20.txt | 1.01 KB | Ada Hernandez |
Comments
Comment #2
Hardik2309 CreditAttribution: Hardik2309 at Iksula commentedComment #3
Hardik2309 CreditAttribution: Hardik2309 at Iksula commentedAdding patch as suggested.
Comment #5
quietone CreditAttribution: quietone as a volunteer commented@Hardik2309, welcome to migrate! Thank you for the patch.
If you look at the errors it reports, 'The "link_uri" plugin does not exist.'. That makes sense since the patch deletes the file instead of moving it. It needs to move from ./core/modules/menu_link_content/src/Plugin/migrate/process/d6/LinkUri.php to /core/modules/menu_link_content/src/Plugin/migrate/process/LinkUri.php. And then correct the 'Namespace' declaration in the LinkUri.php.
You can run the tests locally with something like this:
And the handbook has more info about running PHPUnit tests. Apologies if you already aware of that.
Comment #6
Hardik2309 CreditAttribution: Hardik2309 at Iksula commentedNew patch added as suggested.Kindly ignore the previous patch.
Comment #8
hussainwebFixing the patch in #6. Actually, this was a completely new patch as it was an easy task.
This was done in a live demo on Drupal contributions webinar.
Comment #10
hussainwebMoving test as well.
Comment #12
hussainwebRandom failure
Comment #13
quietone CreditAttribution: quietone as a volunteer commentedThanks for moving the test as well! I did forget to put that the in the Issue Summary. It is added now.
Comment #14
catchShould we add a temporary bc layer here in case someone is subclassing the plugin? Otherwise this can only go into 8.2.x
Comment #15
hussainwebI understand your concerns, but I think it's highly unlikely that someone might be doing that.
Comment #16
phenaproximaI think @catch raises a good point. It's highly unlikely anyone is subclassing it, but this is Drupal, everything is overridable, and we can't be certain. This is a good task for a novice -- let's keep LinkUri outside the d6 namespace, but put a subclass of it in the d6 namespace and mark it deprecated.
The deprecation text should be something like this:
Comment #17
Ada Hernandez CreditAttribution: Ada Hernandez at MTech, LLC commentedHi everyone, I made a patch where added the message for Drupal\menu_link_content\Plugin\migrate\process\d6\LinkUri like @deprecated.
Comment #18
Ada Hernandez CreditAttribution: Ada Hernandez at MTech, LLC commentedI have fixed the previous patch.
Comment #19
phenaproximaExcept for these two things, looks good to me. Thank you, @Adita!
"OtherLinkUri" got a smile from me, but it's kinda vague-sounding; can we import it as BaseLinkUri or DeprecatedLinkUri?
This should be removed.
Comment #20
Ada Hernandez CreditAttribution: Ada Hernandez at MTech, LLC commented@phenaproxima thanks for your commentaries I got better
Comment #21
tstoecklerCan someone explain how this is related to #2669978: Migrate D7 Menu Links and #2822881: Improve Entity URI checking in menu link migration?
The first one introduced a separate uri plugin for the D7 menu link migration and the second one was opened to consolidate that with the D6 version or at least bring it into feature parity.
I don't really understand that in light of this issue, to be honest.
Comment #22
heddnre #21: this is a quick fix to move the class into a non-drupal versioned namespace. When #2669978: Migrate D7 Menu Links went in, it didn't fix the namespace. We'll improve things even more in #2822881: Improve Entity URI checking in menu link migration, but let's get the simple namespace issue fixed first.
#19 is fixed.
Comment #23
tstoecklerAhh, this is just a rename, I understand. In these cases it's nice to create patches with -C -M, so that is more clear. Thanks anyway for the explanation!
Comment #24
heddnRe-rolled patch. No changes so I'm leaving this at RTBC.
(8.2.x) $ git diff --cached -M >process_plugin_link_uri-2816857-24.patch
Comment #25
alexpottThanks for maintaining BC - the patch looks good - just one small thing:
This looks weird - the name 'DeprecatedLinkUri' is being used for the thing that is not deprecated :) - How about just calling it RealLinkUri?
Comment #26
hardikpandya CreditAttribution: hardikpandya at Iksula commentedChanged DeprecatedLinkUri to RealLinkUri.
Comment #27
heddnAnd ready again.
Comment #30
catchCommitted/pushed to 8.3.x and cherry-picked to 8.2.x. Thanks!
Fixed unused use statements on commit.
Comment #31
catch