Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Notice: Undefined index: shortcuts in shortcut_set_customize_submit() (line 314 of X:\dr7\modules\shortcut\shortcut.admin.inc).
Warning: Invalid argument supplied for foreach() in shortcut_set_customize_submit() (line 314 of X:\dr7\modules\shortcut\shortcut.admin.inc).
Comment | File | Size | Author |
---|---|---|---|
#11 | shortcut.png | 60.28 KB | Sivaji_Ganesh_Jojodae |
#8 | 937380-8.patch | 3.44 KB | swentel |
#4 | no-shortcuts.png | 27.5 KB | David_Rothstein |
#4 | shortcut-empty-set-937380-4.patch | 3.52 KB | David_Rothstein |
#3 | shortcut-table.png | 62.67 KB | Sivaji_Ganesh_Jojodae |
Comments
Comment #1
IbnDrupal CreditAttribution: IbnDrupal commentedI just deleted all the shortcutes from the default set and could not reproduce this error. Care to explain what you did to get the error?
Comment #2
David_Rothstein CreditAttribution: David_Rothstein commentedIt seems you have to submit the form on the shortcut set configuration page again (after all the shortcuts are gone) in order to see the error.
This was actually reported a while ago at http://drupal.org/node/851204#comment-3191204 but since that issue originally started off about something else, it's better to handle it here.
The attached patch should fix it; it just modifies the form submit handler to make sure the variable exists before using it.
Comment #3
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commented+1 for #2, patch makes the bad thing to go away however the configuration form doesn't makes much sense when it is empty see the attached snapshot. Is there any issue addressing this ?
Comment #4
David_Rothstein CreditAttribution: David_Rothstein commentedThat's a good point. And actually, if we fix that, we don't need to worry about modifying the submit handler at all, since we'd prevent people from ever being able to submit the form in this situation in the first place.
Let's try the attached patch (and screenshot). This uses the same pattern that other tables in the Drupal admin UI do when they don't have any items in them yet.
Comment #5
David_Rothstein CreditAttribution: David_Rothstein commentedBumping this issue - #1004628: Warning: Invalid argument supplied for foreach() in shortcut_set_customize_submit() was a recently-filed duplicate.
Comment #6
David_Rothstein CreditAttribution: David_Rothstein commented#4: shortcut-empty-set-937380-4.patch queued for re-testing.
Comment #7
Bojhan CreditAttribution: Bojhan commentedIs this RTBC?
Comment #8
swentel CreditAttribution: swentel commentedReroll
Comment #9
Bojhan CreditAttribution: Bojhan commentedGreat to see this standard being used :)
Comment #10
webchickLooks like this fixes a usability issue, as well as an error. Good stuff.
Committed and pushed to 7.x and 8.x.
Comment #11
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commentedLooks good now however I'm not sure how the "Enabled" and "Disabled" row would help. Also the name field in "Add new shortcut" form accepts empty string input perhaps it is already reported in another issue.
Comment #12
swentel CreditAttribution: swentel commented@sivaji , see #1271026: Name of shortcut should be required for the empty string input, weird this never has been reported yet.
Comment #13
Bojhan CreditAttribution: Bojhan commentedActually, the only reason that was introduced is the limit. When that doesn't apply, it should be ok to remove that whole concept.