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.
When a node is already in a menu, it is possible to choose that menu item as it's own parent. Doing this results in an PHP fatal error: "maximum execution time of 30 seconds exceeded". Probably due an infinite loop somewhere. Anyway, the real problem is not the PHP but the fact that you can choose the node itself or one of it's children as parent.
I created a patch for this problem. The patch applies to the 7.x-3.x-dev version. A small modification is need for the 7.x-3.0-alpha5 version.
Comments
Comment #1
seanBThis patch doesn't work (anymore?). The $exclude parameter of _hs_menu_apply_config() expects an array of the menu name and item.
The form_alter function needs to be:
Comment #2
seanBNew patch is attached with some small changed to previous comment.
Comment #3
Demoshane CreditAttribution: Demoshane commentedHello,
we have this issue and it's very prone the crash even whole server if user selects the node itself as parent. I improved the patch a little bit HOWEVER it seems that exclude doesn't work for some reason (Also the additional function $params['exclude'] was always empty so added creation of that). As working solution for now this has jQuery based (inline) failsafe to remove node itself from the parent list.
Comment #5
stefan.r CreditAttribution: stefan.r commentedCommitted, thanks!
Comment #6
stefan.r CreditAttribution: stefan.r commentedComment #8
stefan.r CreditAttribution: stefan.r commentedPossible regression: #2734499: All menus available when selecting the Parent Item