Problem/Motivation

The setting 'override children' on the individual menu link page should show/hide based on the admin config setting 'Allow parents to override children'
The form alter hook is simply named wrong.

Steps to reproduce

Disable 'Allow parents to override children' and the setting is still visible on the menu item page.

Proposed resolution

Fix the form alter hook

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:

Comments

ocastle created an issue. See original summary.

ocastle’s picture

Status: Active » Needs review
StatusFileSize
new753 bytes
littlepixiez’s picture

StatusFileSize
new12.64 KB

Hi @ocastle. Could I just ask for the scenario that this is happening for you? On dev-2.x the form ID for me is correct for the form it is altering: "menu_link_content_menu_link_content_form".

Curious if I'm just missing something here! Thank you.

ocastle’s picture

Hi @littlepixiez, For me, I get dynamic form ids based on the current menu.
e.g. "menu_link_content_main_form" for main menu
or "menu_link_content_account_form" for the account menu.

Changing the hook to use "menu_item_role_access_form_menu_link_content_form_alter" uses the base form id and resolves the issue for me.

In your testing does toggling the admin setting "Allow parents to override children" here: /admin/config/menu-item-role-access show/hide the 'Override children" setting on all the menus for you?

littlepixiez’s picture

Hi @ocastle. Ahh, I just found a similar issue here: https://www.drupal.org/project/menu_item_extras/issues/3043305

It looks like Menu Item Extras changes the form IDs - are you using this module? Menu Token have done a similar approach and changed the hook to the base ID: https://www.drupal.org/project/menu_token/issues/3113646

I'm happy your patch works and fixes it not working with Menu Item Extras installed also! Thanks very much. :)

ocastle’s picture

Yes, it just occurred to me that menu item extras might be doing something as we do have that installed as well.

Glad it’s working!

  • littlepixiez committed 0f47b2a6 on 8.x-2.x
    Issue #3465576 by ocastle, littlepixiez: Override children setting...
littlepixiez’s picture

Status: Needs review » Fixed

Thanks for your contribution @ocastle!

liampower’s picture

Status: Fixed » Closed (fixed)

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