Hi

I'm having issues with the menu link. All menu links gets disabled each time I add a new menu item.

I'll have to enable each menu link one by one every time I add a new menu item.

Any thoughts on this? Thanks.

Comments

VM’s picture

exact version of Drupal 8.x in use? Have you spent any time researching the core issue queue for similar reports?

sophallee’s picture

I have looked around but I'm just getting results on how to disable menu links or similar tasks. There are no mentions of known bugs as mentioned.

I'm using Drupal 8.1.1. Cheers.

moilt’s picture

I have the same issue. Drupal 8.1.2 (plain jane install, just started working on it this weekend).

If I go into each menu item and set the weight and enabled, things work fine. But if I see a list of menu items, sort them, enable them... anything and then click the "Save" button below the menu list, then it disables 2 out of 4 of my menu items and even changes one of their weights.

The first I noticed the issue was when I added a new basic page and added the new menu item.

So you're not crazy, but if yours is like mine, you can work around it for now.

FareedAg’s picture

When you create a new menu item and have entered the details such as title, links, weight, etc; just click the Save button. After the page redirects to the menu list and displays the newly created menu item, don't save the menu list again. I found that clicking the save button for the menu list makes the whole menu list disabled. So just create your menu item, save and it's finished. Hope it works for you.

fahadurrehman’s picture

I was also getting this issue but after changing the php to version 5.6 the issue is resolved.

philip_stier’s picture

Hmm... I'm running PHP Version 5.6.30 and am still experiencing this issue

philip_stier’s picture

I've found that this was actually a problem with my server, in that Suhosin was not enabled. In my instance, I had to contact my server support at LiquidWeb and ask them to add Suhosin arguments to the server's PHP.INI file. The settings that I am using are:

suhosin.request.max_array_index_length = 128
suhosin.post.max_array_index_length = 128 

This allowed variables to be passed to PHP. The issue wasn't with Drupal. I hope that this helps others.

philip_stier’s picture

Turns out the the menu links are still disappearing on me... The Suhosin change seemed to take affect for a little, although I could also be crazy. Will keep researching to see any other solutions I find.

tfladro’s picture

I have the same issue with php 5.6 and drupal 8.5.2

adminMN2023’s picture

I think this is a common issue.... search this: "menu order wont save"

VM’s picture

suggest all those using a deprecated version of 8.x update to 8.3.x to insure the issue hasn't already been fixed in later versions.

adminMN2023’s picture

I have a little time and so I looked at the version release notes and did not see anything referring to the menu, or menu administration et.al.

Thought I would test it anyway as I'm using D8.3.2 - I re-arranged some menus and clicked save.

They all (all 35) went inactive.

So I took one for the team. :^P

philip_stier’s picture

I'll ask the members of my community here in Colorado to see if anyone has experienced this issue as well and maybe has a solution/answer. I know that there are some pretty awesome Drupal techs here.

drlakshan’s picture

Hi

I had the same problem

Drupal 8.4.2

I followed the solution mentioned above. First edit the menu link and enable it there.

DO NOT save again.

Visit the site and come back and do the same for the other links.

Hope this helps

fkelly12054@gmail.com’s picture

On an issue like this, and if you can create a repeatable series of steps on a current version (as I write 8.4.2) you might want to post it over on the issue cue side of the site.  Go into CORE issues, limit to version 8.4.2,  search on "menus" and if you don't see anything similar write up the steps to reproduce and post it. 

I can't duplicate the problem on my 8.4.2 site where I use menus pretty extensively.  You might also look in reports/ recent log messages and browse through your watchdog table in phpmyadmin to see if any errors are being kicked off when you do the save. 

If the developers and maintainers don't know about the problem, they can't fix it.  And they rarely come over to this, the great unwashed side of the site.

sprite’s picture

The problem exists because suhosin is running on the server. 

https://suhosin.org/stories/index.html

suhosin is supposed to be a "security" system, but it creates all manner of configuration aggravation for Drupal sites. 

You need to create a local php.ini file and add the directives below to it. 
 


suhosin.executor.max_depth = 0

suhosin.executor.include.max_traversal = 4

suhosin.executor.disable_emodifier = Off

suhosin.executor.allow_symlink = Off

suhosin.executor.include.whitelist = phar 

suhosin.cookie.max_array_index_length = 256
suhosin.cookie.max_name_length = 256
suhosin.cookie.max_totalname_length = 512

suhosin.get.max_array_index_length = 256
suhosin.get.max_name_length = 256
suhosin.get.max_totalname_length = 512

suhosin.post.max_array_index_length = 256
suhosin.post.max_name_length = 256
suhosin.post.max_totalname_length = 512

suhosin.request.max_array_index_length = 256
suhosin.request.max_totalname_length = 512
suhosin.request.max_varname_length = 256

Once you do the above, you will be able to edit menus properly.

spritefully yours
Technical assistance provided to the Drupal community on my own time ...
Thank yous appreciated ...

donapis’s picture

i can confirm that step by @sprite is working for me. Thanks.

bserem’s picture

I have the same problems without running suhosin.

In small menus (a couple of items) I can enable/disable links. On big menus saving changes does nothing.

I had to edit:
max_input_vars
to solve this. I had to bump it up to a 3000.

--
http://srm.gr - Drupal Implementor

bart3d’s picture

Thank you! Finally this solved it for me! D8.5.0 and php7.2

I also had to uncomment  "max_input_vars" and give it a value of 3000

ChrisGrewe’s picture

I had the same problem, except anything after a number of entries on the big menu would be disabled upon saving. Upping max_input_vars to 3000 solved it for me.

auxiliaryjoel’s picture

I’m having the same problem. 

What folder location and file did you uncomment and adjust the max car inputs in? 

VM’s picture

max_input_vars is in php.ini

you can try overriding in your .htaccess file

google max_input_vars for more information

auxiliaryjoel’s picture

Thanks VM,

FYI  I thought it might be worth pointing out that the max_input_vars did not fix the Menu Structure issue in my particular case.

What did help though was that the cPanel was set to an older PHP version,

Changing it to 7.1 caused the "..an expected error..." white page to appear (instead of loading the site)

FIX: Changing PHP to version 7 though, did not crash the site and DID fix my issue with Menu Structure.

p.s. the max_input_vars are only set to 1000 on my cpanel now, but the version 7 PHP is what allows the Menu Structure to work.

ezra’s picture

Thanks for posting. In my case, I upgraded PHP and lost my php.ini settings in the process, leading to the Max Input Vars changing. It's pretty easy to tell if this applies to you. If your menu edit page keeps the correct values at the top by then is all blank in the enabled column after a certain point, then this bug's for you.

deronimo’s picture

This issue was driving me insane! Increasing the max_input_vars setting to 3000 fixed it.

NicociN’s picture

Increasing max_input_vars worked also for me. Thx !

Rohit Tiwari’s picture

Increasing max_input_vars to 4000 worked for me.

Thanks.