When deleting a node, the function modules/menu.module:menu_node_form_delete() removes a custom menu entry for the node if it exists. The problem is that it will always print a message about a removed menu item, even though nothing has been actually deleted. Suggested fix: use db_affected_rows().

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

killes@www.drop.org’s picture

Status: Active » Needs work

we use && not "and".

wiz-1’s picture

Status: Needs work » Needs review
FileSize
582 bytes

ok I changed and to &&

Jose Reyero’s picture

+1 Patch looks good

ax’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
679 bytes

this is annoying behaviour, indeed, especially when you mass delete nodes. you get a status message like this:

The menu item has been removed.
The menu item has been removed.
The menu item has been removed.
The menu item has been removed.
The menu item has been removed.
The menu item has been removed.
The menu item has been removed.
The menu item has been removed.
The menu item has been removed.
The menu item has been removed.
The menu item has been removed.
The menu item has been removed.
The items have been deleted.

this is a) in the mayority of cases plain wrong, as no menu items got deleted, and b) misleading: you didn't want to delete menu items but nodes, did you?

we don't show status messages for other node_api delete operations (comments etc.), so i'd suggest to just ommit the menu item message. patch attached.

please consider this for 4.7, as it certainly is a usability issue. thanks!

m3avrck’s picture

Agreed :) Code wise, makes sense to me, the message does seem a bit superflluous.

Dries’s picture

Removing the status message sounds like the best solution. I didn't expect such a status message in first place.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)