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
Migrating from a drupal 6 site and get this error:
[error] The internal path component 'https://example.com/publications.html' is external. You are not allowed to specify an external URL together with internal:/.''
Which is coming from MenuLinkParent
because of the assumption that the parent link path is routeable through $url = Url::fromUserInput("/$parent_link_path");
Proposed resolution
Check for external and search for the link uri properties.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#31 | 2968170-18.patch | 4.1 KB | heddn |
Comments
Comment #2
joelpittetComment #3
quietone CreditAttribution: quietone at Acro Commerce commentedAssigning to myself for rvw
Comment #4
quietone CreditAttribution: quietone at Acro Commerce commentedI have a look at this and it only raised questions. MenuLinkParent should be handling external links, but the parent issue already handle external parents, admittedly that did not fix the error that joelpittet was having. Still, it makes more sense to me to report the error there and improve that issue. It doesn't help that I don't know much about menu link either.
Second opinion anyone? Merge this into the parent or not?
Comment #5
quietone CreditAttribution: quietone at Acro Commerce commentedUnassigning
Comment #6
joelpittet@quietone, Thank you for the review! The parent issue seemed to have a wider "task"/refactor scope to it, I created this to keep the scope to the bug as to not confuse the two issues. Though this will force a reroll as they touch a bit of the same code.
Comment #7
quietone CreditAttribution: quietone at Acro Commerce commentedAssigning to self for review
Comment #8
quietone CreditAttribution: quietone at Acro Commerce commentedDiscussed at a migrate meeting and there is no problem adding this separately from the parent issue. However, this does need tests.
Comment #9
quietone CreditAttribution: quietone at Acro Commerce commentedComment #12
joelpittetNow with tests! Thanks @tim.plunkett for helping me understand and @mikelutz for helping me find a place to put these.
Comment #14
mikelutzLooking really good. Only one little nit.
Needs a short comment here "Test plugin when the parent is an external link"
Comment #15
joelpittetThanks for the review @mikelutz
Comment #16
heddnAll feedback addressed and tests added.
Comment #17
idebr CreditAttribution: idebr at ezCompany commentedThe patch in #15 caused my migration to fail:
This change is incorrect:
$loaded
is keyed by entity id, not plugin id:Menu link content id is numeric (eg. 9054), while a plugin_id looks like
menu_link_content:fe151460-dfa2-4133-8864-c1746f28ab27
Comment #18
idebr CreditAttribution: idebr at ezCompany commentedAttached patch contains the following changes:
\Drupal\Tests\migrate\Unit\process\MenuLinkParentTest
:$menu_link_storage
will now returnMenuLinkContentInterface[]
Drupal\migrate\Plugin\migrate\process\MenuLinkParent::transform
: simplified$links
variable similar to the current call to the current$this->menuLinkManager->loadLinksByRoute
Comment #20
LendudeChanges in #18 look good and make sense.
#17 sounds like an integration level test might be good for this, but the Unit tests seem to be the standard for these migration classes, so I guess this is sufficient.
Comment #22
LendudeUnrelated fail in MediaLibraryTest
Comment #24
LendudeSame unrelated fail #3055648: Frequent random fail in \Drupal\Tests\media_library\FunctionalJavascript\MediaLibraryTest
Comment #26
yogeshmpawarAll looks good so setting back to RTBC! Tests failure is not related (see #3055648: Frequent random fail in \Drupal\Tests\media_library\FunctionalJavascript\MediaLibraryTest).
Comment #28
heddnComment #31
heddnRe-uploading #18 as a new patch so we don't keep having test runs (and failures) on the test only patch.
Comment #33
alexpottCrediting @quietone for issue review and @mikelutz and @tim.plunkett as per #12.
Comment #34
alexpottCommitted and pushed 296ba5d866 to 8.8.x and f21ee89c72 to 8.7.x. Thanks!