Closed (fixed)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
5 Jan 2017 at 19:59 UTC
Updated:
6 Apr 2018 at 20:27 UTC
Jump to comment: Most recent
Comments
Comment #2
PA robot commentedFixed the git clone URL in the issue summary for non-maintainer users.
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 #3
gg24 commentedComment #4
vaibhavdev commentedAutomated Review:
Review of the 7.x-1.x branch (commit 6da040e):
Coder Sniffer has found some issues with your code (please check the Drupal coding standards).
FILE: /root/repos/pareviewsh/pareview_temp/README.txt
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
28 | WARNING | Line exceeds 80 characters; contains 122 characters
----------------------------------------------------------------------
Time: 99ms; Memory: 8Mb
No automated test cases were found, did you consider writing Simpletests or PHPUnit tests? This is not a requirement but encouraged for professional software development.
Manual Review:
Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes: Does not cause module duplication and/or fragmentation.
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements.
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.
README.txt
Yes: Follows the guidelines for in-project documentation and/or the README Template.
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
Yes: Meets the security requirements.
Coding style & Drupal API usage
List of identified issues in no particular order. Use (*) and (+) to indicate an issue importance. Replace the text below by the issues themselves:
It is good to put drupal template file in template directory.
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.
Personal Feedback:
Seen one of the best and complete code writing for a module with all the comments and complete readme file. Nice work :)
Comment #5
adriancid@vaibhavdev thanks for your review the problem in the README.txt file is this url that is too long:
https://www.drupal.org/docs/7/extending-drupal-7/installing-contributed-...
I don't know what to do with this. Can I use a short url service for this?
Can you tell if I have other problem to solve please?
Comment #6
vaibhavdev commentedadriancid you can use various shorl url services like google url shortner or bit.ly to make your url short and use that short url in README. Other codes seems fine.
Thanks
Comment #7
neograph734Codesniffer is a tool that recommends best practices. Using a url shortner to pass code validation for a URL in a readme file is nonsense. However, if you must, just use the nid (www.drupal.org/node/895232) ;-)
Overall the code looks good. I have some small things regarding the Drush part:
$index = array_search(0, $onlyone_content_types, 1);The third parameter is supposed to be a boolean value, so it would be better to use TRUE instead. Since you validate the inputs against known content types, I doubt if it ever would be possible to get a 0 there, but then again it is probably there for a reason.
The code is very well written and documented and I could not find any potential issues.
Comment #8
adriancid@vaibhavdev I come from update the link, now the README.txt file its fine. Thanks again.
Comment #9
neograph734Please see my updated post for some remarks.
Comment #10
adriancid@Neograph734 thanks for your comments.
Comment #11
neograph734It is irrelevant for your project application, but I'll open an issue in your sandbox issue queue somewhere this weekend.
Comment #12
xmacinfoAdrian, can you merge your commands to reduce the number? You can create Drush commands that uses arguments. For example, see
drush help role-list.Merge:
These can stay as is:
Comment #13
adriancidMerged the following drush commands:
drush onlyone-available
drush onlyone-not-available
into the drush onlyone-list command.
Comment #14
xmacinfoI did not test the Drush commands yet. However, I see a small UX problem that should be fixed:
The Add Content page still list the type of content that have been configured to accept a Only one node.
When a node Add is disabled, you should at minimum highlight which content type won't accept new content (in fact providing node edition instead).
Can you change the node/add form to something like:
Or simply to:
Comment #15
adriancid@xmacinfo I'll take your comment as a new feature request and I'll open a new issue in the module page. But now that the rules has changed for the project approval do you think that I need this UX change as soon as posible?
I just create a discussion about this at: What are the really use of the ancient Project Application issue queue now that you can promote your own sandbox projects?
Comment #16
xmacinfoYes! I think we can safely mark this issue as fixed as soon as you create the new feature request in your project page.
You will get more exposure and more people will look at your issue queue.
Comment #17
PA robot commentedGit clone failed for https://git.drupal.org/sandbox/adriancid/2674476.git while invoking http://pareview.sh/pareview/httpsgitdrupalorgsandboxadriancid2674476git
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #18
adriancid@xmacinfo I come from create the feature request #2860649: Improve the Add content page, feel free to edit and/or contribute with this ;-)
Comment #19
ayesh commentedLooks good to me.
Small nitpicking may be to make the module title a bit self-explanatory. Machine name is perfectly OK, but the user-facing title could have more information what this module is about.
In the
hook_form_alterimplementation, I noticed that it is executed on forms where it should not have. hook_form_alter is invoked for all the forms, but we only need to alter the node form at this point. If you renameonlyone_form_alterfunction toonlyone_form_node_form_alter(implementinghook_form_BASE_FORM_ID_alter), that function is guaranteed to be called only node edit/add forms. You could also access the full node object and its type (even on node-add forms) and save yourself from substr hassle.I did test it and worked really well. Kudos on great work nicer phpdoc, comments, and clever SQL! If there are no objections, I will mark this fixed in a few days.
Comment #20
adriancid@Ayesh thanks for your comments.
Can you help me with a new name? Or made some suggestions?
I come from change the hook in #2860686: Change the hook_form_alter hook by the hook_form_BASE_FORM_ID_alter hook
Comment #21
Pierre.Vriens commentedMy 2 cents about #18 ...
To be honest when I first heard about your module, I also wondered something like "What is it supposed to do" (I needed to read a bit to find the answer to my question).
Example: if I use (for some other module I co-maintain) "Forena" or "Forena Reports", clearly the last indicates it has to do with Reports, so you may make me curious. So how about something like "Allow a content type only once"? Or variation (better fit with machine name): "Only allow a content type once"? Imagine you get 5 secs on a TV show to promote you module, then "Only allow a content type once" would be a possibly solution to "Deliver your, terribly expensive, message (to create a first impression)". Makes sense, a bit?
PS: if you ever want to consider improving your module from "node" to "entity" you could probably adapt your module's title accordingly ...
Comment #22
adriancidI don't know what do you think about:
Only One Node?
From @Pierre.Vriens we have:
And @Pierre.Vriens is interesting this:
Maybe you want to open a issue in the project queue to works in this approach?
Comment #23
ayesh commentedPierre's suggestions are great, and I would suggest renaming the module title to one of his example too. Seeing as there are no objects regarding code, I'll go ahead and complete this.
Thanks for your contribution, Adrian !
I updated your account so you can opt into security advisory coverage now.
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 #24
klausiAssigning credits.
Comment #26
Rizwan Siddiquee commentedDrupalPractice has found some issues with your code, but could be false positives.
FILE: /root/repos/pareviewsh/pareview_temp/onlyone.module
--------------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
--------------------------------------------------------------------------
13 | WARNING | Global constants should not be used, move it to a class
| | or interface
14 | WARNING | Global constants should not be used, move it to a class
| | or interface
16 | WARNING | Global constants should not be used, move it to a class
| | or interface
17 | WARNING | Global constants should not be used, move it to a class
| | or interface
19 | WARNING | Global constants should not be used, move it to a class
| | or interface
--------------------------------------------------------------------------
Comment #27
Rizwan Siddiquee commented.Codespell has found some spelling errors in your code.
./onlyone.drush.inc:214: cant ==> can't
./onlyone.drush.inc:215: cant ==> can't
./onlyone.drush.inc:228: cant ==> can't
./onlyone.drush.inc:229: cant ==> can't
./onlyone.drush.inc:270: cant ==> can't
./onlyone.drush.inc:271: cant ==> can't
./onlyone.drush.inc:284: cant ==> can't
./onlyone.drush.inc:285: cant ==> can't
./onlyone.module:182: conection ==> connection
./onlyone.module:259: cant ==> can't
./onlyone.module:260: cant ==> can't
Comment #28
adriancidHi @Rizwan Siddiquee I just notice your message, the problem was fixed in #2959285: Move global constants to the OnlyOneInterface interface