Closed (fixed)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
27 Jun 2014 at 08:07 UTC
Updated:
15 May 2015 at 10:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxNovitsh2274341git
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 #2
novitsh commentedPareview gives some strange errors.
Comment #3
novitsh commentedComment #4
gisleNo
README.txtin the repo (onlyREADME.TXT).Also better get this fixed: It appears you are working in the "master" branch in git. You should really be working in a version specific branch. The most direct documentation on this is Moving from a master branch to a version branch. For additional resources please see the documentation about release naming conventions and creating a branch in git.
These may look like just nits to you ... However, the issue queue is long and at least some of us use scripts to automate some of the tasks involved (such as cloning the project environment for testing). Applications that doesn't have a major version branch, a working git clone command, break coding standards and make the code hard to read, or comes with a non-standard README.txt ... are just sand in the machinery. These are not blocking issues, but having them wrong lessens you chances of getting an initial review.
Comment #5
novitsh commentedThank you for the info. I found out my GIT config has an ignorecase setting that was true by default regarding the README.
I have created a 7.x-1.x-alpha branch.
I'm in the progress of fixing the whitespaces. My tabs are set as 4 spaces. It appears standards should be set to 2.
Comment #6
novitsh commentedComment #7
novitsh commentedI have fixed all issues brought up by PAReview. It can be found under http://pareview.sh/pareview/httpgitdrupalorgsandboxnovitsh2274341git-7x-...
Comment #8
guilopes commentedInitial observations
Individual user account
Yes: Follows the guidelines for individual user accounts.
Git Clone Command
No. The correct is git clone --branch 7.x-1.x-alpha http://git.drupal.org/sandbox/Novitsh/2274341.git lesser_forms/
Licensing
Yes: Follows the licensing requirements
3rd party code/content
Yes: Follows the guidelines for 3rd party code.
Project page
Yes
README.txt
Yes
I suggest using db_select rather than in _lesser_forms_read_all_user_roles db_query ()
Comment #9
guilopes commentedRemove the comment line
Comment #10
guilopes commentedComment #11
novitsh commentedThank you for the feedback. The comment is removed and the GIT link is updated.
Comment #12
gisleUnfortunately,
7.x-1.x-alpha, is not a valid branch name.The correct branch name for your project is:
7.x-1.x. Please change the name of the default branch to this. Then add the correct git clone command to your issue summary. The correct git clone command is:Also read the following: Moving from a master branch to a version branch, Release naming conventions and Creating a branch in git - and make sure you understand it.
Comment #13
novitsh commentedUpdated.
Comment #14
novitsh commentedComment #15
gwprod commentedI took a look at your code, and I have some suggestions for you:
Modify your variables so that they are part of one pattern called lesser_forms_config, ie
$settings = variable_get('lesser_forms_config', array());In your admin form, if you make liberal use of '#tree' => TRUE in your containers, you can address your values like so:
In _lesser_forms_configuration_submit()
Then you can address them in lesser_forms_form_alter() by index.
Instead of
You could do:
YMMV though.
Comment #16
novitsh commentedThanks, I've updated the module. Indeed a performance improvement.
Comment #17
Michael Hodge Jr commentedI went through and did an automated and manual review.
Automated Review
The parareview.sh showed no errors in coding standards.
Manual Review
README.txt
Please take a moment to make your README.txt follow the guidelines for in-project documentation. You can find a great template for readme files here
";" At the end of Function Closing Brackets
This is super nit picky, but at the end of your functions closing brackets you have a ";" which isn't needed. You can remove these as they aren't needed.
db_select vs api call
In your _lesser_forms_read_all_user_roles you have a db_select() which appears as though it getting the role names. There is a api function you may want to consider using instead called "user_roles()" which looks like it would return exactly the informatino you need. It's generally better to stick to using the built in API calls if at all possible.
Otherwise, I like the module and as someone who is a big fan of usability improvements this gets a thumbs up from me. Great job @Novitsh
Comment #18
Michael Hodge Jr commentedComment #19
novitsh commentedThank you Michael for the great manual review. I have updated the module.
Comment #20
gaurav.pahuja commentedSome of my initial comments:
This form alter will be executed by all forms. It should be specific to forms.
Either make use of $form_id variable or hook_form_FORM_ID_alter
https://api.drupal.org/api/drupal/modules%21system%21system.api.php/func...
Getting a lot of Notices on configuration page.
Comment #21
novitsh commentedIt is supposed to run on every form, because we don't know in advance what forms may contain the selected checkboxes.
I've fixed the notice you're getting about the invalid argument for checkboxes.
Thanks
Comment #22
madhusudanmca commentedHi Novitsh,
Thanks for you contribution.

I still can see the notices on admin page reported above in comment #20.
Please see below:
You can populate default values at line # "$settings = variable_get('lesser_forms_config', array());" to avoid notices (as in one go they looks like errors).
One more thing, I was wondering If I do not select any user roles then what will rest of settings will do?? I think for selecting any setting, selection of user roles should be mandatory.
Thanks!!
Comment #23
novitsh commentedHello madhusudanmca, thank you for your response.
I've added an if-statement inside the default_value of a checkbox. This should fix the notice.
Good remark regarding the not selecting any roles. I'll note it as a feature request!
Comment #24
novitsh commentedComment #25
pfrenssenDoing a quick code review:
lesser_forms.module:
lesser_forms_form_alter()has a serious bug: this code is running on ALL forms and will hide certain root level elements in the form, regardless of their context (e.g.$form['preview']and$form['author']). This might have very unexpected consequences if this code runs on random forms that might use the same keys. You should usehook_form_FORM_ID_alter()orhook_form_BASE_FORM_ID_alter()instead.$usr_roles, use$user_roles.You don't need to wrap the isset() in parentheses.
This is a rather long winded way to check if the roles are present for the user. PHP has built-in support for this, no need to loop. This whole section can be replaced with a one liner:
lesser_forms.admin.inc:
_lesser_forms_configuration(). Form builders do not typically start with an underscore, and they usually end in_form()to make their purpose clear.I'm sorry to say but I'm not convinced that this module is useful for Drupal users in general. This hides some specific fields in the node edit form, which is a very common use case that typically is implemented in a custom module according to a client's specific needs.
Comment #26
novitsh commentedThank you pfrenssen for the constructive feedback. Will refactor those things and make a new commit available.
Comment #27
novitsh commentedThe changes are available in GIT now.
Regarding lesser_forms_form_alter(): this is the design, it is intended to run on all forms.
Comment #28
pfrenssenNovitsh: that's the bug I mean, the keys that are used in form arrays are arbitrary. I'll give you an example where this can go wrong.
Imagine I have a company called "Bookgeeks" that organises book signing events. My site has a custom form that allows me to plan my events:
I now enable your module because I want to simplify my node forms and no longer show the author field. Suddenly this form which is critical to my business will be broken.
Comment #29
novitsh commentedI'll mark it / work on it as a feature request to let a user define the forms they want to hook on.
Comment #30
robbertv commentedNice looking project. I checked it over and see no major issues. One stylistic change is your function documentation should include information about the parameters passed to them and the return types (per https://www.drupal.org/node/1354).
I can see adding this module to my own site.
Comment #31
novitsh commentedHi @robbertv, thank you for the feedback. I've updated the GIT repository to correspond with comment standards.
Comment #32
agoradesign commentedHi,
first of all thanks for this interesting looking module! Here's my review:
configure = admin/config/content/lesser_forms"Notice: Array to string conversion in form_process_checkbox() (Zeile 3217 von /www/htdocs/w00c1ab7/website-sandbox/test-custom-build/drupal/includes/form.inc)."
This is because all your default values for your checkbox are defined as arrays instead of empty strings.
Comment #33
agoradesign commentedComment #34
novitsh commentedThank you for the constructive feedback. I've already made most changes to the module.
I'm also picking up your feature request into account. My plan is to first release a stable version and then pick up new features.
Kind regards
Comment #35
novitsh commentedComment #36
vingborg commentedPAReview.sh reports nothing but a shortish git commit message and a missing test suite. Everything else checks out.
I have done a full reading on the code and found no issues. Nicely formatted, clearly commented, no glaring mistakes. All the issues pointed out by previous reviews have been handled.
Having hard coded something similar to the functionality of this module on numerous occassions, it is my opinion that this approach solves the problem in a simple, no-nonsense manner that achieves the objective effectively.
Good to go.
Comment #37
novitsh commentedComment #38
novitsh commentedComment #39
novitsh commentedComment #40
novitsh commentedComment #41
klausiReview of the 7.x-1.x branch (commit 889f9a7):
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.
manual review:
But that are not critical application blockers, so ...
Thanks for your contribution, Novitsh!
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 #42
novitsh commentedThanks @klausi, I've checked and indeed I can create new full projects. However I'm unable to promote this project into a full one. See screenshot, I'm missing the promote option?
Comment #43
klausiYou created the sandbox as "drupal.org project" but you should have created it as "module" project. Please create a new sandbox, push the git commits there and copy your project page. Then you should be able to promote the sandbox (and you should delete the old one after that).