Hello,

I'm having a big problem after upgrading from Menu Position 7.x-1.0-beta2 to 7.x-1.0-beta3.

The upgrade itself went fine, but after upgrade, I got a message which read: Existing menu position rules were discovered. They will be disabled until you visit the menu position rules admin page.

When visiting the menu position rules page as instructed, I got the following errors:

   * Notice: Undefined variable: existing_item inmenu_position_edit_menu_link() (line 585 of/var/www/html/sites/all/modules/menu_position/menu_position.admin.inc).
   * Notice: Undefined index: link_path in user_menu_link_alter() (line 1829 of/var/www/html/modules/user/user.module).
   * Notice: Undefined index: link_path in user_menu_link_alter() (line 1835 of/var/www/html/modules/user/user.module).
   * Notice: Undefined index: link_path in menu_link_save() (line 2940 of/var/www/html/includes/menu.inc).
   * Notice: Undefined index: link_path in menu_link_save() (line 2940 of/var/www/html/includes/menu.inc).
   * Notice: Undefined index: link_path in menu_link_save() (line 2978 of/var/www/html/includes/menu.inc).
   * PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'link_path' cannot be null: INSERT INTO {menu_links} (menu_name, plid, link_path, hidden, external, has_children, expanded, weight, module, link_title, options, customized, updated) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12); Array ( [:db_insert_placeholder_0] => navigation [:db_insert_placeholder_1] => 0 [:db_insert_placeholder_2] => [:db_insert_placeholder_3] => 0 [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => 0 [:db_insert_placeholder_6] => 0 [:db_insert_placeholder_7] => 0 [:db_insert_placeholder_8] => menu [:db_insert_placeholder_9] => [:db_insert_placeholder_10] => a:1:{s:5:"alter";b:1;} [:db_insert_placeholder_11] => 0 [:db_insert_placeholder_12] => 0 ) in menu_link_save() (line 2990 of/var/www/html/includes/menu.inc).

These errors come up each time I try to access the menu position rules admin page.

I'm currently using Drupal 7.4. Next I'll try upgrading to the latest Drupal version to see if that helps. I'll post back here if I find anything.

Thanks in advance for any advice of how to fix this.

Regards,
Dave

Comments

metaface’s picture

FYI: I upgraded to Drupal 7.8 and am still getting the same errors when trying to visit: admin/structure/menu-position

Note: The error messages are displayed under another message which reads: Existing menu position rules were discovered and have now been re-configured so they will continue to work.

Thanks,
Dave

combicart’s picture

I've installed the module on a new Drupal 7.8 installation and I get the same error message.

ewills’s picture

Version: 7.x-1.0-beta3 » 7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new1.05 KB

Hmm - I've come across this issue too.

Try the supplied patch - it's giving a warning:

Warning: unserialize() expects parameter 1 to be string, array given in menu_link_save() (line 3018 of /var/www/includes/menu.inc).

But I can't work out how to fix this warning - other than that it seems to work fine.

ewills’s picture

Or maybe I should have read http://drupal.org/node/979464

Guessing this is an issue that will be resolved when Drupal 7.9 rolls in.

Hmm not sure actually, as the error is also in the beta, which should work pre 7.9. Sorry - I'll wait for someone else to shed some light.

guictx’s picture

After latest dev upgrade, menu position rules stoped working and throwing this error. Beta 3 with patch in #3 throws the same error, but menu position rules don't work. It gets weirder: beta2 or latest dev don't work either.

I updated through drush and along with menu_position these other modules were updated:
- i18n-7.x-1.1
- views-7.x-3.x-dev
- token-1.0-beta6

Could it be a problem with one of these?

johnalbin’s picture

The latest Menu position 7.x-1.x-dev only works with Drupal 7.9-dev.

Menu position 7.x-1.0-beta3 is supposed to work with Drupal 7.8.

:-\

guictx’s picture

I uninstalled and deleted Menu Position, installed beta3 back without patching and keep getting this error. I'm on Drupal 7.8.

Any ideas?

GloryFish’s picture

Version: 7.x-1.x-dev » 7.x-1.0-beta3

I was getting the same error message as the OP with Menu Position 7.x-1.0-beta3 and Drupal 7.8.

The patch in #3 worked. I get no error when saving a new rule and the rule is functioning correctly. I am getting the same unserialize() warning.

metaface’s picture

I also applied the patch from #3 and it appears to have fixed the problem (thanks to ewills!)

I am also getting the same warnings as noted in #3. Note: If you have multiple Menu Position rules defined, then the same warning will be repeated, once for each Menu Position rule.

guictx’s picture

I think I figured what my problem is, let my try to explain it.

Here's my main menu structure:

1. Publisher
a. About Us
b. Books
c. Authors
2. Studio
3. Shop

I have a content type called Book and a Menu Position Rule set to assign every node of content type Book to item b. Books in the main menu. Now I want this main menu to expand and collapse as people navigate through the main sections so I'm using menu_tree() to generate it instead of the usual theme_links().

Until last week - before 7.x-1.x-dev was updated - my menu position rule was correctly assigning the active-trail to b. Books (applying active-trail and active css classes) whenever I went to a book node, making the 1. Publisher item to appear expanded.

What happens now - with 7.x-1.0-beta3 with #3 patch - is that the same rule only applies a "collapsed" css class to the b. Books whenever I visit a book node and 1. Publisher doesn't expand automatically (I discovered that "collapsed" was being applied by expanding the whole menu in the menu config).

I suspect this will be solved with http://drupal.org/node/979464, but until Drupal 7.9 comes out is there a workaround for this?

Thanks a lot.

rvilar’s picture

I've installed de beta3 release and the patch in #3 and don't work for me. Any suggestion?

The warning is displayed also.

johnalbin’s picture

johnalbin’s picture

StatusFileSize
new494 bytes

The patch in #3 isn't right; it fixed the PHP error but the logic isn't right. But thanks for quickly locating the source of the bug. Let's try this patch.

jenna.tollerson’s picture

  1. Upgraded Menu Position 7.x-1.0-beta2 to 7.x-1.0-beta3. Got the similar errors as original poster and my rules stopped working.
  2. Applied the patch in #13. Cleared the cache a couple of times then tried to edit a rule, got the same error.
  3. Disabled the module, cleared the cache a few times, then re-enabled the module. Got the "Existing menu position rules were discovered. They will be disabled until you visit the menu position rules admin page." message. Visited the page, edited a rule, and the rules started working again!
  4. Now when I save a rule, I get this error, but other than that everything seems to be working:
    Warning: unserialize() expects parameter 1 to be string, array given in menu_link_save() (line 2965 of includes/menu.inc).

A lot of folks will not do the disable/enable step when upgrading, so that may be a part of this issue.

johnalbin’s picture

Title: Bug: Upgrading from Menu Position » All rules are broken after upgrade to 7.x-1.0-beta3
StatusFileSize
new2.32 KB

Thanks so much, Jenna! I know realize this bug was actually caused by this patch #1298832: Add proper page arguments to the router menu item. That broke all the hidden menu links used by the Menu position rules. And its why disabling and re-enabling fixed it.

This patch adds an update function which acts like a disable/enable step for Menu Position.

And, Jenna, the warning you are seeing in your point 4 can be fixed with the patch in #1266816: Parent menu link of rule shows wrong expand/leaf icon.

johnalbin’s picture

StatusFileSize
new2.3 KB

Actually, update functions shouldn't be setting messages, they should be returning an update message. Updated patch attached.

johnalbin’s picture

Status: Needs review » Fixed

Fixed!

johnalbin’s picture

Menu position 7.x-1.0-beta4 will be out momentarily.

ewills’s picture

Lovely - all working fine this end.

Cheers for the fast fix!

Edwin

guictx’s picture

Hi John, any comment on #10? Latest changes in Menu Position broke functionality for me in that case...

johnalbin’s picture

@guictx There have been 3 patches and a new release since the details you provided in #10. Try the new code and if you still have an issue, you can open up a new issue with the details.

Status: Fixed » Closed (fixed)

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

udomeier’s picture

Hi,
i have update to dp7.9 and Menu position 7.x-2.x-dev, but i become the error:

    Notice: Undefined index: link_path in user_menu_link_alter() (Zeile 1847 von /drupal/modules/user/user.module).
    Notice: Undefined index: link_path in user_menu_link_alter() (Zeile 1853 von /drupal/modules/user/user.module).
    Notice: Undefined index: link_path in menu_link_save() (Zeile 3011 von /drupal/includes/menu.inc).
    Notice: Undefined index: link_path in menu_link_save() (Zeile 3011 von /drupal/includes/menu.inc).
    Notice: Undefined index: link_path in menu_link_save() (Zeile 3054 von /drupal/includes/menu.inc).
    PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'link_path' cannot be null: INSERT INTO {menu_links} (menu_name, plid, link_path, hidden, external, has_children, expanded, weight, module, link_title, options, customized, updated) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12); Array ( [:db_insert_placeholder_0] => navigation [:db_insert_placeholder_1] => 0 [:db_insert_placeholder_2] => [:db_insert_placeholder_3] => 0 [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => 0 [:db_insert_placeholder_6] => 0 [:db_insert_placeholder_7] => 0 [:db_insert_placeholder_8] => menu [:db_insert_placeholder_9] => [:db_insert_placeholder_10] => a:1:{s:5:"alter";b:1;} [:db_insert_placeholder_11] => 0 [:db_insert_placeholder_12] => 0 ) in menu_link_save() (Zeile 3066 von /drupal/includes/menu.inc).

I have no idea, because the Module is the newest...

hongpong’s picture

@udomeier i had about the same error going on. Turning the module off and on works to fix it in my case.

rv0’s picture

Funny, in my case this just appeared after disabling the module and then re-enabling it

Existing menu position rules were discovered and have now been re-configured so they will continue to work.

Error message
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'link_path' cannot be null: INSERT INTO {menu_links} (menu_name, plid, link_path, hidden, external, has_children, expanded, weight, module, link_title, options, customized, updated) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12); Array ( [:db_insert_placeholder_0] => navigation [:db_insert_placeholder_1] => 0 [:db_insert_placeholder_2] => [:db_insert_placeholder_3] => 0 [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => 0 [:db_insert_placeholder_6] => 0 [:db_insert_placeholder_7] => 0 [:db_insert_placeholder_8] => menu [:db_insert_placeholder_9] => [:db_insert_placeholder_10] => a:1:{s:5:"alter";b:1;} [:db_insert_placeholder_11] => 0 [:db_insert_placeholder_12] => 0 ) in menu_link_save() (line 3111 of /data/sites/staging_europacol7/includes/menu.inc).

using 7.x-1.1+1-dev