Just for the records:

Warning: Illegal string offset '#value' in content_menu_form_menu_item_delete_form_alter() (line 263  of .../content_menu.module)

on admin/structure/menu/item/584/delete

(on dummy )

Comments

simon georges’s picture

Hi,

I just tested, and didn't reproduce it. What PHP version are you using? Do you eventually have any other module that could alter menu-related forms?

simon georges’s picture

Issue summary: View changes

added info

geek-merlin’s picture

Status: Active » Needs review
StatusFileSize
new952 bytes

Yep strange: a fresh install did not show that error message.

There are many modules here that could change something but no "esoteric" ones.

Debugging shows that line 263 currently is not doing it right anyway:

function content_menu_form_menu_item_delete_form_alter(&$form, &$form_state, $form_id) {
  if ($form['#item']['mlid']['#value']) {

in my setup we have

$form['#item']['mlid'] == 584

Find attached a patch that "does it right" and fixes the warning here while not breaking other setups.

geek-merlin’s picture

a fresh simplytest.me install of that patch shows no problems and expected result ("Delete associated Article a as well.")

simon georges’s picture

Can someone else confirm that? The patch shouldn't break anything anyway, I'd just like to have a few other situations where the patch is tested (especially with esoteric modules).

klonos’s picture

Status: Needs review » Reviewed & tested by the community

I just had the same error happen on me on a live site. Confirming that the patch in #2 fixed the warning.

PS: the usage stats of this module show nearly 1000 installations. Still there's only 4 people following this issue. That's both surprising and disturbing. I guess most people only delete menu items and not their corresponding nodes (which is when this bug occurs).

simon georges’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks!

klonos’s picture

Thank you Simon! ;)

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

fixed line nuber in dev

a.milkovsky’s picture

Issue summary: View changes

Works, thank you. Do you plan a new release?

simon georges’s picture

It's been some time since I took care of this module, so I certainly could, I don't know if there still are some important bugs to fix before that... I'll have to check.