On a clean install of Drupal 4.7beta 5 when you edit any of the menu items for the first time you get a form that has a title of 'edit menu item', one text field - 'title' and a submit button. When you hit submit a new menu and block (with the name of the menu item) is created that cannot be deleted.

This could be a critical bug. Definately not desirable.

CommentFileSizeAuthor
#1 menu_27.patch619 bytesarchatas

Comments

archatas’s picture

Status: Active » Needs review
StatusFileSize
new619 bytes

I found that the parent IDs (pid) of the items from the modules are equal to 0 (It makes them menu roots) in the database, whereas they should be equal to 1 (They should be Navigation menu items). As I am not very familiar with menu system and I could not find the probleem in menu.inc, I wrote a patch for the menu.module that fixes unwanted behaviour without fixing parent IDs in the database. This patch could be used for Drupal 4.7.0. And maybe someone will fix the problem in the core for Drupal 4.7.1.

It simply checks the type of the menu item instead of checking the parent id, when deciding what to edit - a menu, or the menu item.

-----
Archatas
http://hyperlocal.org

behindthepage’s picture

Thanks for that, it helped me to understand the problem. I changed the database entries for the pid to the correct ones. Once they are correct there is no problem. So I think the problem occurs when the menu table is first filled.

Database.mysql only populates the menu with one entry for the primary links so the problem is not there. I am going to continue looking at the code to see if I can find where the table is first filled. If anyone can point me in the right direction it would be much appreciated.

behindthepage’s picture

Priority: Normal » Critical
Status: Needs review » Active

I have changed this bug to critical as I didn't want it to slip through the cracks.

So far I have tracked the problem down to

_menu_build();

which is called from

menu_rebuild()

Here is my diagnosis (from an incomplete understanding):
_menu_build is passing on negative values for mid and pid. The negative value for pid passes through the rest of menu_rebuild and because the column attribute for pid is unsigned it is saved as zero. The negative mid is checked for and corrected.

The code is just a tad complex for me to get a complete understanding of so it needs a coding guru to look at it.

chx’s picture

Status: Active » Closed (duplicate)

It may or not may be a duplicate of http://drupal.org/node/53350 but I will roll it into that.

chx’s picture

Status: Closed (duplicate) » Active

opsie, bad paste, the issue is http://drupal.org/node/42388

dopry’s picture

Status: Active » Closed (duplicate)

but its stilla duplicate.

behindthepage’s picture

Thanks I will start following that thread.