While working on a migration, I discovered that some content types were missing the Main Menu setting checked at Available menus. For example, the page content type had the following menu settings:
This is the resulting content type in Drupal 8. Notice that Main Menu is not set:
I noticed that Main Menu's machine name in Drupal 7 is `main-menu` while in Drupal 8 this is `menu`. I found out that the menu migration takes this into account and also extends it to other menus whose machine names have changed:
We need to do this same mapping at the node type migration in order to get the expected results.
Comment | File | Size | Author |
---|---|---|---|
Selection_011.png | 40.04 KB | juampynr | |
Selection_006.png | 86.37 KB | juampynr | |
Selection_007.png | 75.67 KB | juampynr |
Issue fork drupal-2998875
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
juampynr CreditAttribution: juampynr at Lullabot for NBCUniversal commentedHere is a patch that adds the mapping so these content type settings are set correctly.
Comment #4
juampynr CreditAttribution: juampynr at Lullabot for NBCUniversal commentedDoh! Wrong patch above. Here is the right one.
Comment #15
quietone CreditAttribution: quietone at PreviousNext commentedThis does look correct to me. I tested using /upgrade and confirmed that the available menus were not updated in the UI. But when using the patch they are.
I have updated the patch and made a fail patch.
Comment #16
quietone CreditAttribution: quietone at PreviousNext commentedAnd lets update this for Drupal6 sources as well.
Comment #18
smustgrave CreditAttribution: smustgrave commentedWith the help of benjifisher and xurizaemon I was able to get my ddev setup working.
Setup a Drupal7 instances
Created a content type called Test Menu, checking "Main Menu" and "Navigation"
With my Drupal10.1 instance running
Ran the import for content types
Verified the content type was brought over
Verified the bug that the menu settings are missing
Rolled back change
Applied patch
Verified the menu settings are now there.
Main Menu -> Main Navigation
Navigation -> Tools
Comment #20
alison#16 worked great for me!
More specifically:
10.110.2 (⬅️ edit) (I forgot we're on 10.2 now).Thank you for the fix!!
Comment #21
benjifisherThe test passes when I run it locally, so I am asking the testbot to try again.
Based on Comment #18, I am setting the status back to RTBC. If the test fails, then the testbot will set it back to NW again.
Comment #22
benjifisherI think the old DrupalCI testbot is seriously broken. I am creating a MR using the patch from Comment #16 so that we can test on GitLab CI.
Comment #24
benjifisherThat's better!
Tests pass on GitLab CI, and the test-only job fails as expected: https://git.drupalcode.org/issue/drupal-2998875/-/jobs/688968.
Comment #28
catchCommitted/pushed to 11.x and cherry-picked to 10.3.x and 10.2.x, thanks!