Closed (fixed)
Project:
Commerce Registration
Version:
7.x-2.x-dev
Component:
Registration Pane
Priority:
Major
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
3 Jan 2013 at 16:57 UTC
Updated:
4 Jan 2014 at 02:42 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
drummComment #2
tvn commentedRegistrations for completed orders indeed miss email and username. To reproduce - create an order with credit card 4111111111111111
http://sales-portland2013.redesign.devdrupal.org/register/ticket-0
Examples of orders on the dev site:
http://sales-portland2013.redesign.devdrupal.org/user/4348/orders/88
http://sales-portland2013.redesign.devdrupal.org/admin/commerce/orders/9...
http://sales-portland2013.redesign.devdrupal.org/admin/commerce/orders/8...
Comment #3
tvn commentedUsername and email are captured for admin user:
http://sales-portland2013.redesign.devdrupal.org/user/1/orders/84
Comment #4
drummThis happens on new registrations when the user only has permission to register themselves.
$entityobject returnsNULLfor$entity->registrant_type($user)instead of one of the 3 valid options.NULL#default_valueis used for the rest of form processing.This patch works around it by only overriding
#default_valuewhen$entity->registrant_type($user)is notNULL.Comment #5
drummFor DrupalCon sites, I've updated this module and registration to the latest dev versions and went ahead and committed this patch to our BZR.
Comment #6
jpontani commentedCommitted.
http://drupalcode.org/project/commerce_registration.git/commitdiff/6e8e1aa
Comment #7
nhck commentedSorry to reopen - the fix will not help with anonymous users.
The workaround should much rather be:
I filed a bug with Entity Registrations: #1892512: registrant_type does not return value
Comment #8
drumm@nhck - I think you may be running into another bug in registration too.
From includes/registration.forms.inc
key()returns the key of wherever$who_option's internal array pointer happens to be. I wouldn't depend on this. Instead,reset(array_keys($who_options))is guaranteed to return the first array key.I've seen this cause other bugs around Commerce, #1879260: More robust query altering for line items, so I expect it could be a problem. commerce_registration should be able to assume that the
#default_valuefromregistration_form()is valid. I'm holding off on filing this since I haven't tested it.It may be worth taking another look at
commerce_registration_create_product_registration()to make sure it creates enough of an object in all cases. I think we might want to populateuser_uidearlier when applicable. For our use case, only registering as myself is allowed, so we wouldn't want a strayREGISTRATION_REGISTRANT_TYPE_ANONcreeping in.Comment #9
drummI filed #1912342: key() is not reliable as a follow-up. Please re-open this, or another issue, if needed. This issue has ensured that we don't overwrite
#default_valuewith something invalid. This module should expectregistration_form()to come with a valid#defualt_value.