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.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | widgets-2202939-4.patch | 529 bytes | nitvirus |
Comments
Comment #1
Vegetal_Gibber commentedComment #2
FuXXz commentedError 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).
Comment #3
joachim commentedTagging as Novice & setting to needs work, as there is a fix detailed here which needs to be made into a patch.
Comment #4
nitvirus commentedHi,
Uploading a patch for the requirement.
Comment #5
sdstyles commented