Closed (fixed)
Project:
Drupal core
Version:
6.x-dev
Component:
user.module
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
21 Feb 2010 at 10:10 UTC
Updated:
3 Jan 2014 at 01:08 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
pillarsdotnet commentedSame problem here.
Patch solves the problem for me.
Comment #2
pillarsdotnet commentedThe bug has apparently been around as long as function itself: Mon, 21 Nov 2005.
Comment #3
pillarsdotnet commentedSlighly smaller/simpler patch; needs testing.
Comment #4
pillarsdotnet commentedTagging. Note that D7 likewise casts
$form_state['values']to an object, in the entity_form_field_validate function.The user_register_validate function was created Mon, 21 Nov 2005, removed Sat, 10 Oct 2009, and recreated Tue, 30 Nov 2010.
So this patch is technically a backport of the fix incidental to:
Comment #5
pillarsdotnet commentedAffects CiviCRM -- that's how I found/fixed it in the first place.
Comment #6
pillarsdotnet commentedBetter title?
Comment #7
pillarsdotnet commentedI can't believe I'm bikeshedding this...
Comment #8
pillarsdotnet commentedPatch in #1 was the correct approach. Re-uploading for the sake of clarity.
Comment #9
gábor hojtsyLooks good. Who else tested this?
Comment #10
pillarsdotnet commentedDunno, but at least one other person (the original reporter) was affected by the problem, and the suggested fix seems self-evident to me. The only other fix I could imagine is to move the cast to user_module_invoke():
Again, it seems self-evident that the patch in #1/#8 is preferable, especially since the D7 patch above is unnecessary and arguably wrong.
Comment #12
pillarsdotnet commentedTrying again...
Comment #14
pillarsdotnet commentedOkay, so the testbot doesn't like it when I follow instructions on how to submit patches.
Trying again with "git diff -no-prefix"
Comment #15
pillarsdotnet commentedGo, testbot!
Comment #17
pillarsdotnet commentedoh, tay.
so maybe testbot is trying (once again) to apply D6 patches to D8 core?
Comment #18
pillarsdotnet commentedComment #19
gábor hojtsyDoes not seem like anybody tested this in the community beyond the patch creator?!
Comment #20
pillarsdotnet commentedI guess nobody cares about fixing long-standing bugs in the d6 api. I get quicker results with d8 bugs, in fact.
Added link on
user_register_validate()api page.Comment #21
pillarsdotnet commentedRe-uploading; I think the testbots are fixed...
Comment #22
pillarsdotnet commented#21: user_register_validate-720876-21.patch queued for re-testing.
Comment #24
pillarsdotnet commentedOpened related #1192088: The user_register_validate() function is faulty and should be removed.
Comment #25
pillarsdotnet commented#21: user_register_validate-720876-21.patch queued for re-testing.
Comment #26
pillarsdotnet commentedRenaming patch to avoid useless core testing as suggested by ksenzee in IRC.
Comment #27
pillarsdotnet commentedOpened related #1192178: The user_module_invoke() function lacks documentation of parameters.
Comment #28
pwolanin commentedSo, I've been testing this patch and related code. I think Drupal core masks the error due to the isset() check in function user_user(), so the rest of the code is never called when an anonymous user registers. However, any contrib module implementing hook_user('validate') will see a notice or worse from this bug, and according to the OP PHP 5.3 is less graceful in handling the case of an array accessed as an object.
This test code on PHP 5.2.6 gives me:
FALSE
TRUE
According to pillarsdotnet PHP 5.3 gives FALSE FALSE which reinforces the fact that 5.2 and 5.3 are different about this.
In any case - the patch is trivial and won't cause any harm and makes core respect its own API.
Comment #29
pillarsdotnet commented#21: user_register_validate-720876-21.patch queued for re-testing.
Comment #30
gábor hojtsyCommitted, pushed, thanks.