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.

Issue fork drupal-2998875

Command icon 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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

juampynr created an issue. See original summary.

juampynr’s picture

Status: Active » Needs review
Issue tags: +migrate
FileSize
968 bytes

Here is a patch that adds the mapping so these content type settings are set correctly.

Status: Needs review » Needs work
juampynr’s picture

Doh! Wrong patch above. Here is the right one.

Status: Needs review » Needs work

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Status: Needs work » Needs review
FileSize
1.61 KB
1.74 KB
2.6 KB

This 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.

quietone’s picture

The last submitted patch, 16: 2998875-16-fail.patch, failed testing. View results

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

With 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

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 16: 2998875-16.patch, failed testing. View results

alison’s picture

#16 worked great for me!

More specifically:

  • It applied cleanly for me on core 10.1 10.2 (⬅️ edit) (I forgot we're on 10.2 now).
  • I successfully regenerated my node type migration (I'm using migrate-upgrade).
  • I ran the node type migration with --update, and the menu settings came in properly 🎉
  • I enabled a custom menu for one of my content types and re-ran the node type migration -- that menu setting came in properly, too (goal: test with a menu that isn't specifically mapped).

Thank you for the fix!!

benjifisher’s picture

Status: Needs work » Reviewed & tested by the community

The 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.

benjifisher’s picture

benjifisher’s picture

That's better!

Tests pass on GitLab CI, and the test-only job fails as expected: https://git.drupalcode.org/issue/drupal-2998875/-/jobs/688968.

  • catch committed 0baa35af on 10.2.x
    Issue #2998875 by quietone, juampynr, benjifisher, smustgrave, alison:...

  • catch committed 30f0a5b3 on 10.3.x
    Issue #2998875 by quietone, juampynr, benjifisher, smustgrave, alison:...

  • catch committed a33a7f8a on 11.x
    Issue #2998875 by quietone, juampynr, benjifisher, smustgrave, alison:...
catch’s picture

Version: 11.x-dev » 10.2.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 11.x and cherry-picked to 10.3.x and 10.2.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.