Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
user.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
17 Jan 2010 at 21:08 UTC
Updated:
29 Jul 2014 at 18:37 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
agentrickardMoving.
Comment #2
starsinmypockets commentedHmm.. this function doesn't seem to be in user.module.
Comment #3
agentrickardLooks like it was renamed to user_register_submit().
Comment #4
starsinmypockets commentedCan the user_access functions simply be removed or do they need to be replaced by some other form of access validation?
Comment #5
agentrickardWe should set a #value in the calling form and respond to that.
Doing so allows form_alter without needing to override the submit handler.
There are related issues in the queue for other submit handlers that need this pattern.
Comment #6
oriol_e9gMaybe with something like this?
Comment #7
oriol_e9gComment #8
oriol_e9gspaces
Comment #9
agentrickardYes, please. The comments need some proofreading for English grammar, though.
Try.
Comment #10
agentrickardOverlooked the actual error in the patch. The submit handler should be:
It is not proper to check $form at this stage. And since 'permissions' get stripped, we might want to change the variable name. Perhaps just 'permission'?
Comment #11
oriol_e9g@agentrickard sorry if you are wasting your time :S Tests are needed/possible?
Comment #12
agentrickardNot a waste at all. You saved me from writing the patch.
Does this functionality already have a test? If so, this doesn't break it. If the functionality has no test, then, yes, we probably need one.
Comment #13
dixon_subscribing
Comment #14
oriol_e9gComment #15
moshe weitzman commentedThis does not look like right fix to me. The form should set #redirect to where it wants to go and then no special code is needed in submit handler. An alternative is to set destination=foo in the querystring when you get to this form in the case when you want a land on a non-standard page after submission.
Comment #16
agentrickard@moshe
That comment seems entirely off-topic here.
Comment #17
tsphethean commentedAgree with @agentrickard - the patch here seems to fix the issue. I've applied the same approach to a patch in http://drupal.org/node/687588#comment-5756978 for a similar issue. Setting back to needs review.
Comment #18
Mike Wacker commentedThe patch is the exact same as in #11, the only difference is the path changed from modules/... to core/modules/...
The patch doesn't introduce a new feature or change anything from a functional perspective, so as long as the unit tests pass, we shouldn't need an additional test for this patch. I did however, insert a drupal_set_message() into user_register_submit() to do some one-off manual testing of the patch, and I confirmed that it works.
Comment #19
webchickHm. Isn't the correct way to do this with #access on the form..?
Comment #20
webchickOh, ok. I get it. The form can be submitted by multiple people, one option of which is an admin. And by moving the access check into the form, it can be altered to some other permission by a module.
Seems reasonable to me, and shouldn't break anything. Committed and pushed to 8.x and 7.x. Thanks!
Comment #21
agentrickardActually, the problem is that you can't form_alter out the admin behavior without rewriting the submit handler from scratch. :-)