No menu on the fly. No custom menus. But the overview, the edit, the enable/disable, the delete/reset works. That's a beginning.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chx’s picture

To test, apply patch and try to add/edit (does changing parent work? what about the weight?)/delete and enable/disable/reset menu items.

blakehall’s picture

Status: Needs review » Needs work

Doesn't apply to an updated CVS checkout of HEAD.

patching file includes/menu.inc
Hunk #2 FAILED at 559.
Hunk #3 succeeded at 630 (offset -3 lines).
Hunk #4 FAILED at 638.
Hunk #5 succeeded at 662 (offset 1 line).
Hunk #6 succeeded at 674 (offset -1 lines).
Hunk #7 succeeded at 726 (offset 1 line).
Hunk #9 succeeded at 927 (offset 2 lines).
2 out of 9 hunks FAILED -- saving rejects to file includes/menu.inc.rej
patching file modules/menu/menu.module
Hunk #2 FAILED at 121.
1 out of 9 hunks FAILED -- saving rejects to file modules/menu/menu.module.rej
patching file modules/node/node.module
Hunk #1 succeeded at 1136 (offset 5 lines).
Hunk #3 succeeded at 2117 (offset 11 lines).
patching file modules/system/system.module
Hunk #1 succeeded at 378 (offset 5 lines).
Hunk #2 FAILED at 2170.
1 out of 2 hunks FAILED -- saving rejects to file modules/system/system.module.rej
patching file modules/user/user.module
Hunk #1 FAILED at 480.
Hunk #2 succeeded at 1868 (offset -4 lines).
Hunk #4 FAILED at 1894.
2 out of 4 hunks FAILED -- saving rejects to file modules/user/user.module.rej

chx’s picture

Status: Needs work » Needs review
FileSize
47.87 KB

Reroll.

blakehall’s picture

Status: Needs review » Needs work

After some trouble shooting in IRC:

  • Updated weights make it to the database correctly (but are reset to zero when you edit again). They also don't seem to affect the menu order.
  • Adding menu items doesn't seem to work either. They make it to the db, but aren't displayed on admin/build/menu.

Disabling / Enabling and Resetting do work as expected.

chx’s picture

FileSize
48.23 KB

Fixes.

chx’s picture

Status: Needs work » Needs review
add1sun’s picture

Status: Needs review » Needs work

Did some quick testing (need to get to work) but here is what I found:

New menu gets added to the DB but does not appear on admin/build/menu.
Editing a menu item worked (title, weight and description) but then it changed Parent Item to Root (whether this was edited or not) and cannot be changed back.
Resetting does nothing. Click the reset button and you are returned to the same page. The menu item still appears in the menu.
Expansion does not work.

On the other hand weighting is working. :)

dmitrig01’s picture

With parents: If I create an item titled Blog entry (blog module not enabled), and I set the parent to Create Content, then it appears under root. If I then set it to have the parent Themes, then it appears under Site Building. So changing parents works, but the items don't appear in the right places. Plus, if I set it to have a parent of My Account, then I get the following error:
notice: Undefined index: user/% in /*****/includes/menu.inc on line 637.

If I disable page and story module in the menu, is it intended behavior for them to still show up on node/add?

dmitrig01’s picture

Reset works as expected.
But one problem I had was if I set admin/content/node to weight 10, it wouldn't stay under admin/content, it would go down to admin. I think this is because the pids are one level too high.

pwolanin’s picture

subscribing... I also want to figure out how the new menu API can fit in with: http://drupal.org/node/128731

chx’s picture

Status: Needs work » Needs review
FileSize
47.17 KB

Seems we were close. Actually, everything worked for me but reparenting.

chx’s picture

FileSize
48.56 KB

Left out menu.install , sry.

chx’s picture

FileSize
49.79 KB

Now, a lot of mysteries are solved -- you can't just add any foo path, it won't work and now there is a validate to enforce valid paths.

chx’s picture

FileSize
49.95 KB

The validate needs to skip external URLs (thanks webernet)

chx’s picture

FileSize
48.55 KB

Against HEAD.

chx’s picture

FileSize
49.95 KB

With install and without parse error.

blakehall’s picture

Status: Needs review » Reviewed & tested by the community

internal paths work

external paths are a TODO (per chx in irc)

updates/adds/deletions/resets etc work

chx’s picture

Yes. I need to think on how external URLs effect everything -- the build, the translate. I do not have the time for them now.

Dries’s picture

How is menu_edit.admin being used, and why?

pwolanin’s picture

Status: Reviewed & tested by the community » Needs work

A node added as a menu item cannot be viewed. To reproduce:

  1. Clean checkout of HEAD
  2. install Drupal, create user #1
  3. apply patch _94 form #16
  4. create a page node (path = node/1)
  5. create a custom menu item at the root level with path = node/1
  6. menu item appears in left sidebar (as expected)
  7. click on menu item- the "Welcome" screen appears even though the URL and breadcrumb are correct
  8. disable menu.module - menu item disappears, node reappears.

same bug with clean, non-clean URL setting. note- PHP 4.4.4, MySQL 4.1.22

pwolanin’s picture

bug #2:

created a second node- tried to add as a child menu item under "My Account".

get error message:

notice: Undefined index: user/% in /Users/Shared/www/drupal6/includes/menu.inc on line 637.

pwolanin’s picture

bug #3:

Edit a newly created menu item pointing to a node. Try to move it to a different place in the menu hierarchy. Form validation error message:

There is already a menu item pointing to this path.

This error may be specific to node menu items. Trying to move a module-defined menu item works, but gives the same notice as above:

notice: Undefined index: user/% in /Users/Shared/www/drupal6/includes/menu.inc on line 637.

pwolanin’s picture

in the list of steps in #20, I should have noted that the menu.module was enabled immediately *after* applying the patch.

chx’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
50.14 KB

Node viewing is noted already in another issue http://drupal.org/node/132225 . It's requires quite some work.

The other two I fixed, thanks.

pwolanin’s picture

@chx- in the context of hierarchical page structuring, the menu module will, I guess, be an example of how another module can maintain custom menu hierarchies? Or will the menu module have an API for this?

chx’s picture

@pwolanin, let's discuss somewhere out of this issue , IRC , IM whatever works for you.

Dries’s picture

I tried the patch and got this:

    * user warning: Illegal mix of collations (utf8_general_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation '=' query: SELECT m.*, me.disabled FROM menu m LEFT JOIN menu_edit me ON m.path = me.path WHERE visible = 1 OR (disabled = 1 AND admin = 0) ORDER BY mleft in includes/database.mysql.inc on line 172.
    * notice: Undefined variable: rows in modules/menu/menu.module on line 180.
chx’s picture

FileSize
50.17 KB

I forgot the utf8 comment from the table definiton. The rows notice is also fixed --but that only fired if you had no items at all which is quite impossible because you are able to see admin/build/menu .

Dries’s picture

Status: Reviewed & tested by the community » Needs work

I think I found a bug: when I update the path of a custom menu item, it doesn't get stored.

How to reproduce: I created a custom menu item 'test', with the path 'user/1'. I then tried to change the path to 'node/1', and it doesn't get updated.

(It's no longer possible to create new menus?)

Dries’s picture

Also, the primary iinks are not longer available?

chx’s picture

Status: Needs work » Needs review
FileSize
49.78 KB

No menus being primary or not -- for now, I wanted to move in small chunks. Fixed the update problem, it was rather trivial, just left out the path column in UPDATE. Made phases into defines.

chx’s picture

FileSize
53.72 KB

More comments and better security practice.

Steven’s picture

Status: Needs review » Fixed

Committed to HEAD.

Anonymous’s picture

Status: Fixed » Closed (fixed)