Closed (won't fix)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
17 Jan 2014 at 14:49 UTC
Updated:
2 Nov 2016 at 17:25 UTC
Jump to comment: Most recent
Comments
Comment #1
adam_thomason commentedHi Kapil,
I have cloned your module using:
git clone --branch master http://git.drupal.org/sandbox/Kirschbaum/2170431.git user_auth_log
However, it seems there are several issues in terms of your module's file structure. I am not sure if perhaps files have been lost through commits or perhaps something else, however when cloned the module folder contains .idea and .git, which means that the module can not be installed to a Drupal site.
please see: https://drupal.org/node/1074360
Also, for proper Git usage, please see: https://drupal.org/node/803746
If you need any help, please ket me know and I'll help as best as I can.
Cheers,
Adam
Comment #2
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 #3
shantanu1 commentedHi Kapil,
Here are some quick issues to get started:
- All functions should be prefixed with your module name.
- Got some spelling mistake.
Also, please take a look at the automated code review results here:
http://pareview.sh/pareview/httpgitdrupalorgsandboxkirschbaum2170431git
Thanks
Shantanu
Comment #4
shantanu1 commentedComment #5
kapil.ropalekar commentedHi Shantanu, Adam
I am committing a module for the first time and want to contribute to the community.
I am not sure if my commits have been proper. I am not able to find any proper guidelines on how to do this. What is the "direct link to my git repository" ? I visited the issue link posted above by Shantanu but why does it say user_authlog.module whereas my module name is account_author.module
Can you pls guide me here. Total newbie...
Regards
Kapil
Comment #6
shantanu1 commentedHi Kapil,
1. You should delete your master branch, according to https://drupal.org/empty-git-master.
2. Branch doesn't match the release branch pattern. It should be 7.x-1.x.
Thanks
Shantanu
Comment #7
Kirschbaum commentedHi Kapil,
Glad that you are contributing to the community! I'm just starting to contribute myself and there is definitely a bit of a learning curve, but totally worth it. I'll keep an eye on this thread and help out where I can. For what it's worth I was able to download your module without issue, but I'm actually only seeing the .info file and nothing else.
Also, I wouldn't worry about the user_authlog module. It looks like shantanu2683 posted the incorrect link.
Comment #8
kapil.ropalekar commentedHi Kirschbaum
Thanks for that reply. I have switched the branch to 7.x-1.x and committed all my files here :
http://drupalcode.org/sandbox/kapil.ropalekar/2175715.git
Am i going in the right direction ? Please can u let me know if you were now able to download all files i.e (.info, .module, .install and README.txt)
Awaiting your reply.
Comment #9
yashsharma01 commentedHi Kapil,
This is good module. I have review this module and find there is missing argument 2 in variable_get function at line
227: $to = variable_get('user_authlog_settings');
Thanks,
Yash
Comment #10
Kirschbaum commentedHi kapil.ropalekar,
No problem. I've taken another look at your module and have a few more comments:
[22-Jan-2014 06:31:12] PHP Parse error: syntax error, unexpected T_STRING, expecting ')' in /Applications/MAMP/htdocs/devel.loc/sites/all/modules/account_author/account_author.install on line 18Hope that helps!
Comment #11
kapil.ropalekar commentedHi Kirschbaum
I was able to delete the master branch and remove the extra (empty) folder.
I have fixed the formatting on all files and also all of the listed errors. Thanks for that pareview.sh link.
Can you pls clone my module again and let me know if its up to the mark now ?
Regards
Comment #12
kapil.ropalekar commentedChanging Status back to Needs Review
Thanks
Comment #13
Kirschbaum commentedComment #14
Kirschbaum commentedHi kapil.ropalekar,
I was able to download and enable the module without issue this time. It seems to function as described. I don't have any any additional comments about the code. Perhaps some of the more advanced reviewers will have some additional comments.
Good luck!
Comment #15
klausiIf you are confident that this project is ready please set it to rtbc next time. Thanks!
Comment #16
kapil.ropalekar commentedHi Kirschbaum, klausi
Thanks for reviewing the module. I will keep that in mind to set the project to rtbc in future when i am confident.
What are the next steps that i take now to convert my sandbox into a full project ?
Thanks
Comment #17
kapil.ropalekar commentedComment #18
gisleThis tiny project has been untouched for five months, so it is time to give it a full review.
Automated Review
The automated review of your project by PAReview has found some issues with your code. As coding standards make sure projects are coded in a consistent style we ask you to please have a look at the report and try to fix them. While these are all trivial errors, things like wrong indents makes your code harder to review.
Manual Review
Also. Please take a moment to make your project page follow tips for a great project page. It should argue the use case for this project better..
field_author_uid) for the user entity if this field does not already exist when the module is enabled, and deletes it when the module is uninstalled.It then goes on to implement
hook_user_insert()to insert the uid of creator in this field when a new user is created. The use case is to keep track of creators of users.It is too simple to count as a real module, as it have no tables on its own, no configuration settings and no user input.
It does not follow the guidelines for project length and complexity.
However, it looks useful, and IMHO deserves to be promoted to a full project provided it is cleaned up a bit.
However, a larger and more complex project should have been submitted for review to apply for the "Create Full Projects" permission. (But I shall leave it to a git admin to make the final call on this.)
hook_enable()and erased byhook_uninstall(). While this works, it is unconventional. The symmetric solution where field is created byhook_install()and erased byhook_uninstall() should be used instead..For such a tiny module, I think the starred items (*) warrant going back to Needs Work. The rest of the comments in the code walkthrough are recommendations. I would like to read the code again when it is formatted properly.
Comment #19
gisleAdded tag.
Comment #20
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.
Comment #21
ashwinshHello Kapil,
Your module looks good. Please check following "Automated Review" and try to resolve them.
See http://pareview.sh/pareview/httpgitdrupalorgsandboxkapilropalekar2175715...
Thanks,
Comment #22
ashwinshComment #23
klausilet's keep this closed until we hear back from the applicant.
@ashwin.shaharkar: please review issues that are in the "needs review" state, thanks!
Comment #24
kapil.ropalekar commentedHi klausi,
I have resolved all the "Automated Review" issues. Can you kindly review it help me in promoting this project.
Comment #25
kapil.ropalekar commentedComment #26
gislePlease don't assign the review task to yourself. Assigning an issue to yourself is problematic for several reasons. If you want to contribute to the Drupal community, you need to learn the community conventions - including those about assigning ownership to issues.
Ok, now for the review.
First: The code now passes automatic robot review. This is good thing.
Two years ago, I wrote:
This is very small and trivial project that consists enable and uninstall hooks (27 lines) plus a single function (7 lines), giving a total of 34 lines of PHP code (after stripping comments and blanks). It creates a field (
field_author_uid) for the user entity if this field does not already exist when the module is enabled, and deletes it when the module is uninstalled. It then goes on to implementhook_user_insert()to insert the uid of creator in this field when a new user is created. The use case is to keep track of creators of users.It is too simple to count as a real module, as it have no tables on its own, no configuration settings and no user input. Hence this is tagged "PAReview: Single project promote".
However, this time around I would like to add:
The new field is named
field_author_uid. This is an unfortunate choice because it is generic and may create name collisions with other modules that also would like to have afield_author_uid. The Drupal convention for function names is that names should include the project's machine name to harden them against name collisions. I believe best Drupal practice is also to do this with field names defined by contributed modules.Provided the module is properly named "Account creator" (see below), the field it defines should be named
field_account_creator_uid. This also makes it clearer what the field is used for (i.e. to store the uids of account creators).In #18, I suggested that the project was renamed "Account creator", to better communicate its purpose. The author has changed the name of the sandbox to "Account creator" and the git clone instructions also clones a project of that name. However, the .info, .module and .install files are all named
content_author. Having project file names and function names that do not follow Drupal naming conventions occupies two name spaces where one would do, and may even disrupt another project if somebody (after checking if there exist a project with the machine namecontent_authorand not finding any) mistakingly believes that this namespace is unused. I think it is important for a project to be promoted, that its author demonstrates that he or she cares about coding standards and some basic conventions for module Drupal development. Because the Drupal project involves thousands of developers, each developer need to take care to avoid name collisions and other disruptions of other developer's projects.Coding style & Drupal API usage:
The starred items (*) warrant going back to Needs Work.
Comment #27
kapil.ropalekar commentedHi gisle,
Sorry about the assigning part. I was not aware of the Drupal community conventions.
I have fixed all issues for the project and also renamed the the .info, .install and .module files as well as the function names.
Also added a Help for my module.
Can you kindly review the same again and let me know if i can add any other features into it.
Comment #28
kapil.ropalekar commentedComment #29
gisleThank you adding
hook_help.All the issue raised in #26 have been fixed.
Just a few nits:
hook_help, instead of "Thus arissed the need for this module", I would suggest the following sentence "Hence the need for this module arose".However, these are not blockers, so I am moving this forward to RTBC. Please note that promotion to full project will not happen until a Git administrator have given this a second set of eyeballs.
Comment #30
kapil.ropalekar commentedHi gisle,
Thank-you for your review and suggestions. I have pushed suggested changes to remote.
Comment #31
kattekrab commented@kapil.ropalekar you might want to review some other projects in order to get the review bonus.
See http://drupal.org/node/1975228
Comment #32
kapil.ropalekar commentedComment #33
kapil.ropalekar commentedHi kattekrab, gisle
As per your suggestions I've made manual reviews on other projects and updated them in project description.
Thus adding Issue tags for my project.
Thanks !
Comment #34
kapil.ropalekar commentedComment #35
klausiRemoving review bonus tag, you have not done any manual review, you just posted the output of an automated review tool. Make sure to read through the source code of the other projects, as requested on the review bonus page.
Comment #36
kattekrab commented@kapil.ropalekar - please review and comment on the code in the module.
You can use this template to check for some of the key things we need to watch out for...
https://groups.drupal.org/node/427683
You can also test the module with simplytest.me
Eg like this http://simplytest.me/project/2562355 <= use the sandbox ID number.
When you have done those reviews, paste links to the reviews into your Issue Summary here.
Good Luck! And thank you for helping us test new projects!
Comment #37
dman commentedSorry that this relatively straightforward module application has been so long in the queue.
One reason for this to happen is that the Project name and the Project description itself are somewhat unclear, and hard to puzzle out...
If you are committing to providing a useful utility to the Drupal project library, then tips for a good project page suggest that you should clearly describe and sell why someone would want to use this module. Your project page should clearly describe some use-cases and examples, and maybe keywords that would help someone who was looking for a tool like this to find it. Think like a site-builder - how would they find your module, and why would they choose to use it?.
For similar reasons, it's hard for module reviewers to look at your module in a list and decide it was worthwhile reviewing, or what they would expect if they spent time doing so! Modules that are opaque in their purpose, provide no clear benefit, or do not provide sufficient testing instructions to allow someone to evaluate them are likely to get passed over in favour of more potentially useful ones..
(Heck, I'm only looking at it today because the most interesting thig about it is that it's at the bottom of the queue by date)
On inspection, I see that you have somewhat more interesting and useful help in your hook_help! Go ahead and copy that to your project page.
---------------------
Looking at the module itself ...
I'm afraid it's pretty sloppy. There are some immediate issues just from a quick scan.
In account_creator_enable(), you do check to see if the field_base was created, but not if the field_instance was. These are separate logical checks.
If an editor were to simply delete the field instance in field UI, /admin/config/people/accounts/fields/field_account_creator_uid/delete (but leave the field_base behind), then this logic would no longer work as expected. Sure, you don't *expect* an user to do that, but OTOH, you should not fail without warning.
If you were to take responsibility for creating and deleting fields - then you have to take responsibility for doing that cleanly.
Also - in field_create_field(), you have used the field_name 'field_account_creator_uid' - which has the prefix 'field_'.
Although it's not clearly documented, modules that provide their own custom fields, use their own module name as a prefix on the field_name. The core 'field' module provides field names that are prefixed with 'field_'. That's what is happening there. I understand why you copied it, and there are some tutorials out there that make the same mistake, but there is some understanding needed here.
gisle already described this issue in #26 above.
Your custom field is provided by your module, so the machine-name for it should be just
That prevents it from being confused with a user-managed field that field_ui added.
You have the creator account managed as 'text' - when clearly the only valid value there would be 'integer'.
... Or not, as it looks like anyone with the totally normal ability to 'manage own account' now has edit rights on this field, and is able to change the value of this field and therefore re-assign their own master account, or enter invalid data there! Surely this is not appropriate for the use-cases that this utility would be appropriate for?
The account creator shows up unfiltered on public user account pages - I would say that this would be expected to be undesirable behaviour in almost all use cases. It's easily fixed afterwards, but is bad default behaviour.
And before I even finish .. the line in
account_creator_user_insert()
doesn't use the correct entity_metadata_wrapper() approach for data manipulation.
A nice tutorial on entity_metadata_wrapper() is here
.. :-(
Given the high frequency of obvious Drupal-API problems in such a remarkably small sample of code - this review cannot pass.
It took me longer to point out all the things wrong with this version than it would take someone else to write a better version.
It seems that a site-builder would be able to get the same result as this module by just thinking about the problem and using a single Rules action to do this job powerfully.
For all the above reasons, I've got to put this application down again.
Sorry, but the problems outweigh the point of the module so hard it's pretty severe.
It's a little crazy that it's been in the queue so long only to get to this. But it's not been promoted - because it's not promote-able.
Comment #38
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.