Problem/Motivation

Once #2301239: MenuLinkNG part1 (no UI or conversions): plugins (static + MenuLinkContent) + MenuLinkManager + MenuTreeStorage is in, it would be possible to no longer hardcode the maximum depth of menus: MenuTreeStorage::MAX_DEPTH

Proposed resolution

  • Generate the schema using a configured maximum length
  • Try to not allow lowering the size

Remaining tasks

User interface changes

API changes

Postponed until

#2256521: [META] New plan, Phase 2: Implement menu links as plugins, including static admin links and views, and custom links with menu_link_content entity, all managed via menu_ui module

CommentFileSizeAuthor
#25 fix-max-depth-menu-tree.patch4.83 KBjnicola
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pwolanin’s picture

not sure the idea here - we could make it a constructor param, but that could cause problems if the table already exists.

Or, we could just make sure we e.g. loop over the depth instead of hard-coding any uses of p1 .. p9 in the schema function and other code?

xjm’s picture

Issue summary: View changes
Status: Active » Postponed
mgifford’s picture

Status: Postponed » Active

unblocked.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.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.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.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.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

mstrelan’s picture

Title: Make the maximum menu length configurable » Make the maximum menu depth configurable

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.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.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.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.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

wombatbuddy’s picture

Just in case, if someone needs a menu with unlimited depth, than you can use 'Hierarchical Taxonomy Menu' module.

DYdave’s picture

Hi guys,

Is this still supposed to happen at any point?

Issue was set "active" at #3, 5 years ago and hasn't changed since.

Should it be set to "Postponed" again?
Should its version also be updated? Perhaps to 9.0.x-dev?

Thanks in advance for any update.
Cheers!

apaderno’s picture

Version: 8.6.x-dev » 8.9.x-dev
Nick Hope’s picture

"Just in case, if someone needs a menu with unlimited depth, than you can use 'Hierarchical Taxonomy Menu' module."

Unfortunately it's not unlimited. it cannot show more than 10 sub-levels. I really need about 15 for a full tree of living things.

wombatbuddy’s picture

@Nick Hope,

Unfortunately it's not unlimited. it cannot show more than 10 sub-levels. I really need about 15 for a full tree of living things.

it can be easily fixed by editing 'HierarchicalTaxonomyMenuBlock.php' file.
I have crated the path for #3063209.

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.

jnicola’s picture

Ran into this problem on a monolithic menu setup that we have. One sub groups menus finally crested 10 depth and it all went to heck!

I'm writing a patch right now that will increase depth to 10. We'll see how it actually goes. Not sure how configurable we can make this since menu depth is all stored in separate columns versus one column containing all parent information and depth (p1, p2, p3... etc etc p9). This would be something worth looking at when overhauling menu in Drupal core going forward. From what I can tell this is actually leftover from some choices in Drupal 6!

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.

jrwest_webguy’s picture

@jnicola -- Any progress on a patch to increase to 10?

Adding a menu-via-taxonomy module does not address the shortcomings of the Core Drupal menu system. Also, as far as I can tell, migrating from a node-based menu to a taxonomy-based menu is a tremendous undertaking. It's 2022, web servers are bigger, stronger, and faster than what they were 14 years ago. The menu depth should be configurable, ideally per menu, imho.

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.

jbaum_13’s picture

I am in need of this capabiltiy. Currently I am unable to add nodes to the menu in the desired location since it is not showing me all of the children. The options change from node to node depending upon the depth of the children for that node.

For ex. one page node I try to add to the menu and I can see the full menu:

Full menu

Then I will access another node and try to add it to the menu and it only shows one level:

Limited Menu

We have a large site with lots of Academic content that is past the max depth of 9. Any recommendations on how to change the max depth would be much appreciated.

jnicola’s picture

@jbaum_13 --> Not sure what combination of modules you are using, but we've got a lot of experience with crazy menus here at OHSU if you ever want to talk architecture that helps handle all of that!

We've had plenty of mistakes to learn from and a decent amount of success that might work for you as well :) Feel free to reach out if you want.

For a patch that someone asked for a while ago and I missed, here's what we wrote and are utilizing at OHSU as part of what we're up to. It's definitely not ready to be utilized into care as is and hasn't been tested beyond our very specific monolithic menu approach (which we're moving away from) so no guarantees this has any value at all, infact it may make things worse so implement at your own risk, haha.

jbaum_13’s picture

@jnicola thank you so much for your quick response! I tried the patch as is and got the following error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'p10' in 'order clau
se': SELECT "menu_tree".*
FROM
"menu_tree" "menu_tree"
WHERE ("menu_name" = :db_condition_placeholder_0) AND ("depth" <= :db_condi
tion_placeholder_1) AND ("enabled" = :db_condition_placeholder_2)
ORDER BY "p1" ASC, "p2" ASC, "p3" ASC, "p4" ASC, "p5" ASC, "p6" ASC, "p7" A
SC, "p8" ASC, "p9" ASC, "p10" ASC, "p11" ASC, "p12" ASC, "p13" ASC, "p14" A
SC, "p15" ASC, "p16" ASC, "p17" ASC, "p18" ASC, "p19" ASC, "p20" ASC; Array
(
[:db_condition_placeholder_0] => main-menu
[:db_condition_placeholder_1] => 1
[:db_condition_placeholder_2] => 1
)

Thank you so much for your help! I greatly appreciate it!

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.