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
Menu link content entities can not be stubbed (menu_name can't be null) so we need to make sure the parents come first.
Proposed resolution
Order the source by depth.
Comment | File | Size | Author |
---|---|---|---|
menulinkorder_testonly.patch | 2.07 KB | chx | |
menulinkorder_fix.patch | 2.63 KB | chx | |
Comments
Comment #1
chx CreditAttribution: chx commentedComment #2
chx CreditAttribution: chx commentedThe test change should be committed but the fix shouldn't after #2232477: Fatal when adding new fields with NOT NULL constraints in a base table that contains existing entities. We have a similar problem with taxonomy but that can't be depth ordered and that suffers the same problem so a bigger fix is needed and that is that: abolish NOT NULL in the base table.
Comment #3
eliza411 CreditAttribution: eliza411 commentedI know we're looking a different direction for a fix here, so please disregard this if it's not helpful. I was continuing to test menu link migrations with menulinkorder_fix.patch. The migration seems to succeed, no errors thrown, but any migrated menu with a second layer of depth (or more) displays the Drupal error screen, and the log files say:
Word of warning, if you place the menu without checking, the site give one of these:
If you have just changed code (for example deployed a new module or moved an existing one) read http://drupal.org/documentation/rebuild
None of the tips (deleting files/php content, clearing cache etc.) helped, so I started over.
Comment #4
benjy CreditAttribution: benjy commentedNow #2232477: Fatal when adding new fields with NOT NULL constraints in a base table that contains existing entities has been committed do we just need a test? I can't actually see what changed in the test only patch?
Comment #5
mikeryanThis seems obsolete - the field patch was committed long ago, plus the query is now ordered by depth as the original resolution suggested. And, like benjy, I've looked at the test diffs up and down and cannot see the difference.