The "delete" option for an user-created widget set doesn't work. When you try to delete a widget set, Drupal returns to the widget set list displaying an "undefined index" notice, and the set will remain on the list (even though it says "Set X was deleted").

The cause of this problem is a missing "&" in the widgets_set_delete_form() function prototype. The parameter $form_state is passed as a value, so the form doesn't register the widget set reference and nothing is deleted.

Solution:

To fix this, simply edit line 492 of widgets.admin.inc:

function widgets_set_delete_form($form, $form_state, $set) {

...and add the missing & to $form_state:

function widgets_set_delete_form($form, &$form_state, $set) {

Hope this helps anybody.

CommentFileSizeAuthor
#4 widgets-2202939-4.patch529 bytesnitvirus

Comments

Vegetal_Gibber’s picture

Assigned: Vegetal_Gibber » Unassigned
FuXXz’s picture

Error if i delete definitions
Notice: Undefined index: data in drupal_process_attached() (line 4501 of /includes/common.inc).
Error if you reverse a set
Notice: Undefined index: widgets_set in widgets_set_revert_form_submit() (line 542 of /sites/all/modules/widgets/widgets.admin.inc).
Notice: Undefined index: widgets_set in widgets_set_revert_form_submit() (line 543 of /sites/all/modules/widgets/widgets.admin.inc).

joachim’s picture

Version: 7.x-1.0-rc1 » 7.x-1.x-dev
Status: Active » Needs work
Issue tags: +Novice

Tagging as Novice & setting to needs work, as there is a fix detailed here which needs to be made into a patch.

nitvirus’s picture

StatusFileSize
new529 bytes

Hi,
Uploading a patch for the requirement.

sdstyles’s picture

Status: Needs work » Needs review