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
Comment #1
metaface commentedFYI: 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
Comment #2
combicart commentedI've installed the module on a new Drupal 7.8 installation and I get the same error message.
Comment #3
ewills commentedHmm - 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.
Comment #4
ewills commentedOr 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.
Comment #5
guictx commentedAfter 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?
Comment #6
johnalbinThe 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.
:-\
Comment #7
guictx commentedI uninstalled and deleted Menu Position, installed beta3 back without patching and keep getting this error. I'm on Drupal 7.8.
Any ideas?
Comment #8
GloryFish commentedI 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.
Comment #9
metaface commentedI 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.
Comment #10
guictx commentedI 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.
Comment #11
rvilarI've installed de beta3 release and the patch in #3 and don't work for me. Any suggestion?
The warning is displayed also.
Comment #12
johnalbinComment #4 in #1266816: Parent menu link of rule shows wrong expand/leaf icon might be related.
Comment #13
johnalbinThe 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.
Comment #14
jenna.tollersonWarning: 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.
Comment #15
johnalbinThanks 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.
Comment #16
johnalbinActually, update functions shouldn't be setting messages, they should be returning an update message. Updated patch attached.
Comment #17
johnalbinFixed!
Comment #18
johnalbinMenu position 7.x-1.0-beta4 will be out momentarily.
Comment #19
ewills commentedLovely - all working fine this end.
Cheers for the fast fix!
Edwin
Comment #20
guictx commentedHi John, any comment on #10? Latest changes in Menu Position broke functionality for me in that case...
Comment #21
johnalbin@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.
Comment #23
udomeier commentedHi,
i have update to dp7.9 and Menu position 7.x-2.x-dev, but i become the error:
I have no idea, because the Module is the newest...
Comment #24
hongpong commented@udomeier i had about the same error going on. Turning the module off and on works to fix it in my case.
Comment #25
rv0 commentedFunny, in my case this just appeared after disabling the module and then re-enabling it
using 7.x-1.1+1-dev