Score:0

How can I extend the maximum number of items in a menu?

aw flag

I maintain a website where a particular content type is always displayed with a left-hand navigation menu present. As part of the process for adding new content of this, the site editors add a link to to the content to the left-hand menu. However, they do not enable this link, although the relevant parent item is enabled. Thus when users visit the content page, the left-hand navigation menu displays just the parent items for the content, with the parent highlighted.

The problem I have is that currently editors are unable to add more links to the left-hand navigation menu. They can navigate to the "Add Link" form for the new item, and can fill it in without difficulty. However, when they click the Save button, the following error message is displayed:

enter image description here

Note that nothing is recorded in the PHP error log when this happens.

However, if they remove an existing link, they can add a link to replace it, suggesting that they have hit an internal limit on the number of links that can be present. The editors believe that they encountered this problem before, when the site was being maintained by a third party external contractor, and that the limit was raised.

I have searched the Drupal 7 documentation, but have been unable to find any indication that there is an upper limit on the number of links a Drupal menu may contain. Searches of StackOverflow and the wider web have been similarly unproductive.

There is nothing in the website's settings.php file that would control the number of items a menu can have. I have checked the Drupal database, but the menu_custom table does not contain any field for maximum items. (I checked the menu_links table, and found that at present there are 1310 items in the left-hand navigation menu, of which 1059 are hidden. Note that not all of the non-hidden items are displayed at once, as the site supports two languages.)

I'd like to know where I can increase the number of items a menu can have, or if this is some kind of fundamental limit, where this is documented, so I can explain the situation to the site owners.

id flag
This question does not fundamentally explain what actually happens when an editor tries to add one additional menu item. In general, when I hear this I think of https://www.drupal.org/project/drupal/issues/1565704 and https://www.drupal.org/project/drupal/issues/2742371, but without a precise technical description of the meaning of "unable to add" I am afraid this question is unanswerable in its current form.
user871967 avatar
aw flag
Apologies, I've edited the original description now to describe what happens in more detail. Unfortunately the error message itself isn't particularly helpful.
id flag
Understood. You must look harder for some logging on that. It’s a 500 error.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.