In the rules admin ui I have the path "admin/rules/rules/%" as well as others below that like "admin/rules/rules/%/delete" or "admin/rules/rules/%/edit/%". The problem is now that the paths "below" doesn't get the parent correctly assigned. So they loose the overall context, meaning even the administration menu point is closed - what is weird.

The problem is that "admin/rules/rules/%" gets hidden set to -1 and as a consequence the parent is set to 0 and the context is gone. Is there a cause for doing so?

I tried removing this behavior, which fixed the problem for me and i didn't note any other issues with it. Patch attached.
Note: I had the problem in d6, but I think it applies to d7 as well. The patch is for d6, but applies to d7 too.

CommentFileSizeAuthor
#5 menu_parents_d7.patch904 bytesfago
menu_parents_fix.patch846 bytesfago
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fago’s picture

Title: Menu item looses parents when parent is hidden » Menu item looses parents when parent is a router item only

fixing title

mitchell’s picture

Status: Active » Needs review
apaderno’s picture

Does the issue apply all times the parent menu contains %?

Status: Needs review » Needs work

The last submitted patch failed testing.

fago’s picture

FileSize
904 bytes

ok, it's not so simple.. ;) Menu items appearing in the tree may not have callbacks as parents, as then wouldn't be displayed any more. I've updated the patch, so it allows just callbacks to have other callbacks as parents.

Updated patch for d7 attached, applies to d6 too (and fixes my problem there).

fago’s picture

Status: Needs work » Needs review
chx’s picture

Status: Needs review » Reviewed & tested by the community

Nice catch. These are the hardest to find, these half line fixes...

pwolanin’s picture

Status: Reviewed & tested by the community » Needs work

please re-roll w/ diff -up, can't readily tell what function this is affecting.

Also, I think I understand the problem, but a little further explanation would help.

Also code comment is > 80 chars.

webchick’s picture

Three things:

1. This sounds like a big edge case we're likely to break again without a test. So let's add one.
2. Unless mine eyes deceive me, that comment is wider than 80 chars.
3. The comment could also use some work. While I'm sure it's technically accurate, it doesn't tell me "why."

pillarsdotnet’s picture

Title: Menu item looses parents when parent is a router item only » Menu item loses parents when parent is a router item only

Spelling correction in issue title.