Closed (outdated)
Project:
Commerce Registration
Version:
7.x-2.x-dev
Component:
Registration Pane
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Jan 2013 at 17:06 UTC
Updated:
28 Feb 2025 at 22:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mallezieI think it's better to use a form alter to set the form element to required, than you don't have to 'hack' commerce_registration.
Comment #2
nhck commentedIt would be better to fix the bug.
$form['registration_information'][$prodkey][$prodkey . '-reg-' . $i]['anon_mail']['#required']; - can by definition, never be true thus this whole line and mechanism is pointless. It also adds a wrong decision to commcerce_registration b/c the email adresses are never validated.
Comment #3
jpontani commented$form['registration_information'][$prodkey][$prodkey . '-reg-' . $i]['anon_mail']['#required'] can be set to true with a hook_form_registration_form alter implementation.
However, I changed the logic to better incorporate valid email address checking if the user enters anything into that field.
http://drupalcode.org/project/commerce_registration.git/commitdiff/b39b30d
Comment #5
Sammii commented@jpontani Can you please clarify specifically how to set the email field on the Registration form to be required?
This thread in Entity Registrations Issue Queue implies that the field should be required but just does not display as such. However, I am able to submit the Registration form with a blank Email field and I encounter no errors. I do not see any settings in the admin that allow me to make this a required field, but neither could I remove it if I wanted! Tried both the beta and the dev versions of Commerce Registration.
You mentioned:
Can you please detail exactly how to code this? I updated to dev version and created a module where I try to call hook_commerce_registration_information_checkout_form_alter() (based on information from https://drupal.org/node/1927376) but it doesn't appear to be firing...
Comment #6
alan d. commented@jpontani
If you do that, then that hidden field with other registration types will flag a validation error??
The default behaviour is required, so
$mail_is_required = TRUE;appears to be correct in relation to the parent module (albeit not the cleanest way to implement this).Comment #7
leducdubleuet commentedSince the parent module is requiring the mail field by default, I believe that commerce registration should do the same. It makes no sense to have to implement a hook or to hack
$mail_is_required = TRUE;in order to achieve what should be default.Also, I have experienced entity malformed exceptions caused by empty email field with current Commerce Registration 7.x-2.1 and Entity Registration 7.x-1.6.Turns out they were caused by multiple registrations on the same order.So I propose the attached patch to make the mail field required in the checkout form by default to be inline with entity registration and prevent errors since it is not ready to have that field optional.
Comment #8
DevJoshLopez commentedTested #7 and it works. It does not show a required asterisk though. Thank you!
Comment #9
alejcerro commentedI've also tested #7 and it works for me. This should be incorporated into the module since the default functionality doesn't actually work, i.e. email field for "other" users is not actually required.
Comment #10
john.oltman commented