Module Description
Address Field Email expands the functionality of the addressfield module by enabling the collection of an email address within an address field.
This module was created specifically for the scenario where a multi-value address field is being used to store information about multiple individuals, so each individual's email address could be referenced separately.
It uses Drupal core's email validation, and therefore only has the address field module as a dependency. The code for this module is mostly based on addressfield_phone, which enables the collection of phone/fax related information in an address field.
Project Page
https://www.drupal.org/sandbox/lionguard/2660538
Git clone command
git://git.drupal.org/sandbox/lionguard/2660538.git
Comments
Comment #2
th_tushar commentedHi lionguard,
First of all, Thanks for your contribution!
While manually reviewing your code, I found couple of security issues.
In views/handlers/addressfield_email_handler_field_address_email_nr.inc file,
Don't just return the email value entered by user, use
return $this->sanitize_value($email);instead ofreturn $email;.In views/addressfield_email.views.inc file,
The user facing text should be passed through
t()function and use placeholders to replace variables instead of string concatenation.Also in module file, the
t()function and use placeholders to replace variables instead of string concatenation.Changing the status to "Needs work". Please fix the above issues and change the status back to "Needs review".
Comment #3
lionguard commentedThank for your the comments, to confirm I have added a sanitization function to the email field, as well as wrapped the text description in T() by using placeholders to replace variables instead of string concatenation. I could not find any t() references in the module file itself which use concatenation, if I have missed something please do let me know.
Thanks!
Comment #4
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxlionguard2660538git
We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #5
lionguard commentedThat automated review tool is pretty cool, I was not aware of it and the major issues it highlighted have been corrected.
Comment #6
lionguard commentedI've addressed the issues highlighted by the automated tool and pushed the new code - thanks!
Comment #7
extremal commentedHi lionguard,
Automated review:
http://pareview.sh/pareview/httpsgitdrupalorgsandboxlionguard2660538git
Shows that there are still some issues to fix.
(I think prepare() method in MigrateAddressEmailFieldHandler class will always return NULL. Perhaps typo?)
Manually I spotted that in the addressfield_email_addressfield_types() function it would be nice to move static $addressfields variable above the if condition.
Otherwise it will be running the db query several times on each request.
Try:
Comment #8
dkolarevic commentedPlease update your git clone command:
git clone --branch 7.x-1.x https://git.drupal.org/sandbox/lionguard/2660538.git addressfield_emailComment #9
neograph734In general the code looks pretty nice. There are some strange names like
addressfield_email_handler_field_address_email_nr(an email number?) but this should not affect the working of the code.The same is with the automated review. Some of the function documentation is missing, for further development and people writing patches it might be useful to have a bit more documentation. But again, I don't suppose that should prevent your module from getting accepted.
At some points I believe the code might be overly complicated:
If you do not plan to support multiple email types (whatever that may be), only the render function will suffice and the options are not really required.
I suppose that in the code above line 274 (
'email' => 'Email',) in addressfield_email.module still needs to be wrapped in t()?Apart from those issues the code looks pretty good to me. Looking forward to using this.
Comment #10
neograph734Oh, one more small thing. The project shortnames of address field and address field phone are
addressfieldandaddressfield_phone; yours isaddress_field_emailaccording to the git clone command.Perhaps it is an idea to remove the first underscore so the folder name matches the module name? This makes the module compatible with Drush and follows the other modules :)
Comment #11
addonsolutions commentedPlease add a comma on the last multiline array item. Like..
array(
'description' => $name ? t('!label of field %name', array(
'!label' => $value['label'],
'%name' => $name,
)
Please check it on all code.
Comment #12
visabhishek commented@addonsolutions: looks like you forgot to change the status. Is this now RTBC after your review or are there application blockers left and this should be set to "needs work"?
Comment #13
parthpandya24 commented@lionguard
I think first of all you need to update all the errors and warnings of automated review tools.
https://pareview.sh/node/602
Thank you.
Comment #14
PA robot commentedClosing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).
I'm a robot and this is an automated message from Project Applications Scraper.