Using drupal 7.8 & PHP 5.3.6

1. Create a vocabulary [Voc] like this:
2. Create a new content type, add a field [Term reference], WIDGET[Hierarchical Select], and set [Voc] as the vocabulary.
Save lineage: Save only the deepest term[selected],
Level choice: Force the user to choose a term from a deepest level[selected],
Resizable: Enabled[selected]
4. Add a new content with field [Term reference],
Expected: normal
Warning: explode() expects parameter 2 to be string, array given in menu_node_submit() (line 691 of D:\Program Files\VertrigoServ\www\drupal\modules\menu\menu.module).

Attachments are the related pictures.

Please help to check if you guys can reproduce.
Thank you very much!


robertorc87’s picture

I have this message too.
nothing more to add to your analysis, I'm doing something similar to you and it popped right there, same identical modules and passages.

It seems showing only on the backend, if I'm not wrong.

acbramley’s picture

I'm getting this with the hs_menu and is actually rendering the module completely useless. I can't save a menu item using hs_menu because I get this error on node save:

Warning: explode() expects parameter 2 to be string, array given in menu_node_submit() (line 691 of .../modules/menu/menu.module).
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'menu_name' 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] => [:db_insert_placeholder_1] => 0 [:db_insert_placeholder_2] => node/631 [: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] => Find out if you are eligible [:db_insert_placeholder_10] => a:0:{} [:db_insert_placeholder_11] => 0 [:db_insert_placeholder_12] => 0 ) in menu_link_save() (line 3001 of .../includes/

This is using content that previously was saved without using hs_menu, but I have tried removing the old menu item first before saving again but it doesn't work any better.

acbramley’s picture

Priority:Normal» Major
beeleg’s picture

Status:Active» Needs review

I fixed this bug by adding an IF statement like this in menu.module file at line 705:

if (!is_array($form_state['values']['menu'])) {
    list($node->menu['menu_name'], $node->menu['plid']) = explode(':', $form_state['values']['menu']['parent']);
firebird’s picture

Component:Code - Taxonomy» Code - Menu
new1.11 KB

Here's a patch that fixes the node saves.

firebird’s picture

new1.36 KB

..and here's a patch that also fixes the re-population of the hs elements broken by the previous one.

acbramley’s picture

Patch in #6 now makes HS Menu function correctly! (as long as jquery_update module is disabled)

giancarlopiccinini’s picture

If you found the patch can fix all the file hs_menu.module
I did not understand the lines to change
you can put it here for download this file
I have an urgent need to create Web

if I disable Hierarchical Select Menu
Hierarchical Select No error

Giancarlo Piccinini Italy

----- translated by ------

rv0’s picture

I think this is a duplicate issue
patches already here
#1272538: Hierarchical Select Menu should also flatten on submit of node forms

firebird’s picture

Yes, it does look like a duplicate issue indeed.

Does your patch correctly re-populate the HS fields the next time the node form is loaded? I had to add another line of code (see patch).

rv0’s picture

It does on my site.
But that might be fixed by another patch which is in this issue queue.
#1271386: Hierarchical Select Menu should respect menu_options
or another one, which I'm having trouble finding atm ;)

In any case it is not related to this issue about node_submit...

Taxoman’s picture

Version:7.x-3.0-alpha5» 7.x-3.x-dev
Priority:Major» Critical

The two other issues mentioned are reported to be in conflict with each other, and neither of them is deemed to be critical (or having the exact same scope as this one, although perhaps overlapping somewhat).
This issue, however, seems to be a real showstopper, hence its Critical status.
If the latest patch here is ok, and resemble an "easy fix", it should be committed to -dev asap.

rv0’s picture

Status:Needs review» Closed (duplicate)

both issues have been reported months ago, have been (partially) reviewed by the maintainer of HS, and are RTBC afaik.
the 1st issues' patch fixes this issue.
the 2nd issues' patch fixes another issue, and clashes with the first over 1 line of code, I'm not going to lose even more time with this by rolling combo patches (it's really basic and can be done manually)

a small look at the patch in this issue reveals it is not up to standard (why link to this issue in the comments?)
also the "re-populate the HS fields" part is unrelated to this issue.

cross posting and duplicate patches wont help push this issue forward.
closing this in favor of #1272538: Hierarchical Select Menu should also flatten on submit of node forms

FreeFox’s picture

Status:Closed (duplicate)» Reviewed & tested by the community

Maybe this is closed but I don't find the error message nor a patch in the "other" post so I suggest we keep this one open.

I tested the patch in #6 and my problem with "Warning: explode() expects parameter 2 to be string, array given in menu_node_submit()" is gone so I would say ... please commit

Sorry for re-open, if not ok, please close again. I'll don't touch it again ;)

rv0’s picture

Status:Reviewed & tested by the community» Closed (duplicate)

FreeFox, I really don't like playing issue ping pong

I don't find the error message nor a patch in the "other" post so I suggest we keep this one open.

There's 2 patches in that post, how can you not find it? ...

ArchangelGuidz’s picture

Confirming that applying patches 5 & 6 works! Thanks!

Wim Leers’s picture

seehive’s picture

Just to confirm that Patch in # 5 & #6 works fine for me , thanks for great work!!!

tweaker’s picture

just a heads up

Wim, I see above this is considered fixed #18

- I'm seeing it on a new install Oct 25, 2012 for the version above - on Save

Will apply patch per #19

my mistake this should have been posted to 7.x-3.0-alpha5

I will load the dev version instead [resolved]

AaronA’s picture

Verified that patches in #5 & #6 work for me also. Could this be rolled into the next release please?

AaronA’s picture

Status:Closed (duplicate)» Reviewed & tested by the community
axel.rutz’s picture

Status:Reviewed & tested by the community» Fixed

looks like this is already in current dev.

Status:Fixed» Closed (fixed)

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

smallcoder’s picture

Just posting a THANK YOU - this code was a life saver ;)