This module is created because, I found a situation in many projects when at the time of registration process it is necessary to send an email attachment.
This module solve that purpose.
Dependency = Mimemail Module
Admin can configure the attachment allowed extension from
<SITENAME>/admin/config/account_settings_email_attachment
and can attach element at URL
<SITENAME>/admin/config/people/accounts
GIT Clone
======
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/riju.srk/2401475.git
account_settings_email_attachment
Manual reviews of other projects:
- https://www.drupal.org/node/2420901#comment-9596347
- https://www.drupal.org/node/2420625#comment-9597705
- https://www.drupal.org/node/2423361#comment-9619543
- https://www.drupal.org/node/2427175#comment-9629535
- https://www.drupal.org/node/2428745#comment-9647065
- https://www.drupal.org/node/2333787#comment-9647101
Comments
Comment #1
arijits.drushComment #2
jlbellidoYou should change the following in your issue description:
git clone --branch 7.x-1.x riju.srk@git.drupal.org:sandbox/riju.srk/2401475.gitto
git clone --branch 7.x-1.x http://git.drupal.org:sandbox/riju.srk/2401475.git account_settings_email_attachmentAutomated Review
http://pareview.sh/pareview/httpgitdrupalorgsandboxrijusrk2401475git you have some coding standars errors in your project and you should fix them. Please, fix them before put this issue at needs review state.
Manual Review
for example, change
to
The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.
This review uses the Project Application Review Template.
Regards!
Comment #3
arijits.drushComment #4
arijits.drushThank you ,
I am really new to contributing code to drupal.org
As you suggested I did following
Checklist
git clone --branch 7.x-1.x http://git.drupal.org:sandbox/riju.srk/2401475.git account_settings_email_attachmentThanks & Regards
Arijit
Comment #5
arijits.drushComment #6
arijits.drushComment #7
PA robot commentedWe 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 #8
arijits.drushComment #9
arijits.drushComment #10
arijits.drushComment #11
arijits.drushComment #12
darol100 commented@arijits.drush
Thank you for contributing,
I have review this module and everything seem to be working fine. I did not see any blockers issue. Also, I have run coder review, Pareview.sh and I did not see any complain.
Manual Review
The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.
If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.
This review uses the Project Application Review Template.
Comment #13
arijits.drushThank You darol100,
For reviewing this.
can anyone please give me permission to create a full project.
Thanks
Arijit
Comment #14
arijits.drushComment #15
arijits.drushComment #16
klausimanual review:
The variable naming is a blocker right now. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #17
arijits.drushHi klausi,
Thanks for taking time to review this
I changed following things.
Comment #18
arijits.drushComment #19
arijits.drushComment #20
arijits.drushComment #21
arijits.drushComment #22
klausimanual review:
But otherwise looks RTBC to me.
Assigning to stBorchert as he might have time to take a final look at this.
Comment #23
stborchertIf you use
in your code the variable will contain the default value ('gif png jpg jpeg pdf doc xls') if the user hasn't configured anything different, yet.
See variable_get() for more information about this.
I'll have a deeper look into the code ...
Comment #24
stborchertQuick scan of code (in-depth review will follow):
* Use
variable_get()with defaults and you can completely remove account_settings_email_attachment.install.* Code style could be improved ;) (missing blank lines between functions, indentation, ...).
*
account_settings_email_attachment_help(): You don't need to use all those if-statements here. Look at the Features module for a clean implementation.*
account_settings_email_attachment_form_user_admin_settings_alter()(and other): The variable$account_settings_email_attachment_attach_idis empty on first visit, so$account_settings_email_attachment_attach_id[$counter]does not exist (in "#default_value"). Use default values invariable_get().*
account_settings_email_attachment_form_user_admin_settings_alter()(and other): The variable$counteris not named very well. Please use a name matching the meaning of the variable.*
account_settings_email_attachment_form_user_admin_settings_alter(): make the upload path for the attachments configurable. Personally I would never store this in the public-files directory.*
account_settings_email_attachment_mail_alter(): Sending emails without saving the email settings first will cause an error because$account_settings_email_attachment_attach_id[$counter]does not exist.*
account_settings_email_attachment_set_attachment_config(): Why do you replace spaces with comma here? This is very uncommon. Additionally you need to replace it back inaccount_settings_email_attachment_set_attachment_config_submit()(which could be omitted completely).Comment #25
arijits.drushThank you Klausi & stBorchert,
I am taking it back to
.
I really appreciate the time spent by you to review my code.
I will be back in 2 weeks on this with updated code.
Do not know if review bonus need to delete,up to you guys.
Thanks
Arijit
Comment #26
arijits.drushHi Klausi & stBorchert,
I am planning to add multiple file upload support and upload directory configurable on next iteration.
Please let me know your thoughts on it.
Thanks
Arijit
Comment #27
klausiaccount_settings_email_attachment_help(): do not use filter_xss_admin() and check_plain() here since the README content is trusted, not user provided input.
Back to stBorchert to conclude his review.
Comment #28
arijits.drushHi Klausi,
I thought it is good practice, but as you said.
I understand your point it is not necessary to go through another function while input is provided by module developer.
1.) account_settings_email_attachment_help(): do not use filter_xss_admin() and check_plain() here since the README content is trusted, not user provided input : Done
Comment #29
joshi.rohit100When calling account_settings_email_attachment_mail_attachment() method, there might be a chance that user has not uploaded any file. I this case, variable
contains value 0 and
these two lines will cause the problem.
Also I don't understand why system_settings_form() is not used for account_settings_email_attachment_set_attachment_config() and so there will be no need to have submit handler.
Comment #30
arijits.drushHi Rohit,
Thanks for the review
now added code to check
fid >0rather thanfid != NULLand I did not used system_settings_form() ,because I did not knew about it.
I was wondering what stBorchert means by
Thank you for giving me the clue.
Thanks
Arijit
Comment #31
klausisystem_settings_form() can handle the variable_set() calls for you. Check out https://api.drupal.org/api/drupal/modules!system!system.module/function/... and examples that use it such as https://api.drupal.org/api/drupal/modules!book!book.admin.inc/function/b...
So there were no major objections here and this was RTBC already ...
Thanks for your contribution, arijits.drush!
I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.
Comment #32
arijits.drushThank you,
Everybody for helping me on this.
Special thanks to klausi + stBorchert + joshi.rohit100.
For code review and let me learn all those things.
Thanks
Arijit