The calls to confirm_form in the following functions use the wrong API, and need to be rewritten.
_drupal_delete()
user_confirm_delete()
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | user_edit_fix_3.patch | 8.9 KB | pwolanin |
| #8 | user_edit_fix_2.patch | 6.92 KB | pwolanin |
| #6 | user_edit_fix_1.patch | 6.91 KB | pwolanin |
| #4 | patch_149.txt | 992 bytes | asimmonds |
| #3 | patch_148.txt | 9.25 KB | webernet |
Comments
Comment #1
webernet commentedAttached patch fixes user_confirm_delete() and removes _drupal_delete() and some nearby code which appears to be a remnant of the deletion API.
Comment #2
gábor hojtsyYou introduce an associative array with the "description" key which will be a parse error. Also, are you sure that drupal_redirect() is not used elsewhere. Sure, it looks like a deletion API remaining, but still, it would be good to check.
Comment #3
webernet commentedCopy paste error...
I searched for all three functions being removed and didn't find anything.
Comment #4
asimmonds commenteduser_confirm_delete() requires a &$form_state parameter as it's called from drupal_get_form, also the old code had 'Delete' and 'Cancel' for it's options.
I've shifted the removal of the DAPI functions to http://drupal.org/node/156778 (Incomplete DAPI rollback), as IMO that issue is more suited to remove that code.
Comment #5
pwolanin commentedwebernet says we also have this warning:
where arg 1 is form state
Comment #6
pwolanin commentedholy cow, what a mess.
I think this patch straightens out the menu callbacks and FAPI bits for this part of the user module. Note, as with this patch: http://drupal.org/node/166644 a form builder should never be calling drupal_set_title() or doing anything other than building the $form array.
Comment #7
pwolanin commentednote - some menu paths are changed by the patch. After applying the patch you need to rebuild your menu (easiest way is to enabe/disable a module). Test whether user accounts can be edited and deleted.
Also, the patch removes some use of raw $_POST carried over form pre-FAPI.
Comment #8
pwolanin commenteda couple comment and code-style cleanups caught by webernet.
Comment #9
webernet commentedLooks OK, tested OK.
Comment #10
pwolanin commentednote this patch looks bigger now because per request from chx it moves the code around a little to get a better grouping of the submit/validate functions with with relevant form builders.
Also adds a negative #weight to the 'Account' fieldset so it comes on top.
Comment #11
eaton commentedMore readable, better arrangement of the code, and -- as an extra bonus -- it now works! Tested and approved.
Comment #12
gábor hojtsyThanks for the cleanup! Committed!
Comment #13
(not verified) commented