Synopsis
Private notes is used to create node specific private notes on content pages. These notes are private and it is visible to only those users who have given user roles with permission to add/view notes.
It provides block consisting of "Add note form" & list of notes by node id. Onwers can also delete their own note.
Requirements
Recommended modules
Roadmap
This module is ready to go live.
Known problems
Pledges
I pledge that this project will be ready for Drupal 8!
Credits
Currently mepushpendra is the active maintainer of this module.
Gittip/Flattr/Paypal
Help wanted!
Any help is welcome, this project is available at https://www.drupal.org/sandbox/mepushpendra/2758273
Similar projects and how they are different
Dependencies
Restrictions
Git clone command
git clone --branch 7.x-1.x https://git.drupal.org/sandbox/mepushpendra/2758273.git private_notes
cd private_notes
Manual reviews of other projects:
https://www.drupal.org/node/2770029#comment-11440515
https://www.drupal.org/node/2770971#comment-11440719
https://www.drupal.org/node/2771627#comment-11440791
Comments
Comment #2
yogeshmpawarHi mepushpendra,
Please change git clone URL of the project. The URL you have added in this post is for maintainers.
If we use this URL to clone the project then it asks us to provide mepushpendra@git.drupal.org's password.
Please change the URL so that community members can clone and review the module.
Comment #3
yogeshmpawarHi mepushpendra,
Pareview.sh is giving following errors.
http://pareview.sh/pareview/httpgitdrupalorgsandboxmepushpendra2758273git
Will do a manual review in some time.
Comment #4
mepushpendra commentedPlease find the git command for non-maintainer
git clone --branch 7.x-1.x https://git.drupal.org/sandbox/mepushpendra/2758273.git private_notes
Comment #5
mepushpendra commentedComment #6
mepushpendra commentedThank you for your valuable suggestion. I have completed code changes as per the code review suggestion.
Please review once again.
Comment #7
PA robot commentedProject 1: https://www.drupal.org/node/2758289
Project 2: https://www.drupal.org/node/2758295
As successful completion of the project application process results in the applicant being granted the 'Create Full Projects' permission, there is no need to take multiple applications through the process. Once the first application has been successfully approved, then the applicant can promote other projects without review. Because of this, posting multiple applications is not necessary, and results in additional workload for reviewers ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).
If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #8
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 #9
nixou commentedHi mepushpendra,
I reviewed manually your module.
It's mostly ok but there is some problem :
After enabling your module, I put the Block "Add notes" into the first sidebar.
Then I go to a node page (node/2) and I get the following fatal error :
I renamed the function "private_notes_show_on_node_type" in "_show_notes_on_node_type" to continue to test.
Then I got this warning :
I tried to configure the block "Add notes" and I see that the settings as a title "Select Content Types on which you want to perform sentiment analysis".
I think this title is wrong because we are not about "Sentiment analysis" here.
So I checked "Article" in these settings.
Then I went to an article node full page and I added some notes.
All works fine but I got a notice per note at each page load :
Your permission "Delete a Note" as a description "User is allowed to delete their own private notes".
But actually a user can delete a note of another user (in my case, anonymous with this permission can delete notes of admin).
You may change this description or limit deletion for own note only.
Comment #10
nixou commentedComment #11
nixou commentedI just see another problem.
In "private_notes_note_add_note" you add CSS with "drupal_add_css".
This is not good because if you active CSS aggregation here /admin/config/development/performance your CSS will not apply anymore.
You must use $form['#attached']['css'] instead.
Comment #12
mepushpendra commentedHi Nixou,
Thank you for your detailed feedback. I have fixed all the issues mentioned by you, see the details below.
1. Fatal error: Call to undefined function _show_notes_on_node_type() in /var/www/html/sites/all/modules/custom/private_notes/private_notes.module on line 82 - Renamed function
2. Warning: in_array() expects parameter 2 to be array, null given in _show_notes_on_node_type() (line 104 of /var/www/html/sites/all/modules/custom/private_notes/private_notes.module). - Added extra check
3. Notice: Undefined property: stdClass::$realname in _private_notes_fetch_content() (line 307 of /var/www/html/sites/all/modules/custom/private_notes/private_notes.module). - Changed to $user_info->name
4. Delete a Note - Changed the functionality to delete own note
5. In "private_notes_note_add_note" you add CSS with "drupal_add_css".
This is not good because if you active CSS aggregation here /admin/config/development/performance your CSS will not apply anymore. - Chnaged to $form['#attached']['css'] instead of drupal_add_css
Please review.
Thanks,
Comment #13
hardikpandya commentedHi mepushpendra,
It would be good if you add dependencies in your info file.Rest your module seems ok.
Best Regards
Comment #14
visabhishek commented@hardik.p : 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 "needs work"?
Comment #15
mepushpendra commentedHi hardik.p,
There isn't such dependency on any other modules, as most of the functionality provided by core only. Please check again and let me know if you find some.
Thanks
Comment #16
yogeshmpawarManual Review
Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
No: Causes 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/README.md
Yes: Follows the guidelines for in-project documentation and/or the README Template.
Please refer to this link https://www.drupal.org/node/2181737 for 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
Nothing.
This module looks good and working for me. also there are no blocker points left.
So i am marking this module as RTBC.
Comment #17
naveenvalechaWhat is the usecase of the module. Can you add that in Readme.txt
Manual Review :
drupal_uninstall_schema('private_notes');pnidbe the better primary key name thannotenumAssigning to myself to review it thorougly tonight
Comment #18
mepushpendra commentedHi Naveen,
Thanks for your review. I have made changes as per your suggestion in Comment# 17.
Please review and promote for full release.
Thanks,
Pushpendra
Comment #19
naveenvalechaManual Review :
.PrivateNotes > .title) in css file. pinged @Manjit.Singh for providing his thoughts on css.This comment needs update
node_type_get_names()instead of'#description' => t('Your note should not exceed 512 characters'),Moving back to N/W due to open questions.
Comment #20
manjit.singh@mpushpendra Thanks for contribution. :)
As you are using this hierarchy in tpl file then you also use .PrivateNotes .title as well. But if your target is to style only to child element of PrivateNotes then code look good.
Comment #21
mepushpendra commentedHi Naveen,
Thanks for the detailed review. I have incorporated all changes as suggested by you & Manjit.
Please review again and do the needful.
Comment #22
PaoloN commentedHi mepushpendra, I had a quick look at your module and done my bit of review :)
The indications in the manual review part are not binding, they're not the reason why the review failed.
The automatic review is giving a minor problem, due to the missing default branch.
Automated Review
Git errors:
Git default branch is not set, see the documentation on setting a default branch.
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/README.md
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
- Possibly add a TOC in the Readme
- Tests missing
- In your private_notes_show_on_node_type() you're nesting an IF statement inside another. You could just create a single IF statement with both conditions inside. Also, since the function only returns a bool, you can simply return the evaluation of those conditions, removing the need for the IF statement all together.
- In private_notes_delete_note(), please pass through the t() the elements of the header for the tableselect form element.
- In private_notes_note_add_note() you're calling _private_notes_fetch_content() twice. It makes DB queries and the second call is unnecessary. On line 180, you can change if (_private_notes_fetch_content()) into if ($notes_content = _private_notes_fetch_content()) , so if the condition passes, $notes_content will already contain what you need, instead of making another DB query.
- The variable "private_notes_allowed_content_types" is supposed to be an array, but when you pass a default value in the variable_get (lines 76 and 126) you pass an empty string. Please use array().
- The value stored in the DB is presented in different ways: in the form to add a new note, you're showing the output raw from the DB (checkplained by the _private_notes_fetch_content() ), but in the delete form, you're passing it through strip_tags(). Consider a more uniform way of display sanitised content
- Consider adding a configure entry in the .info file, for your block
Comment #23
mepushpendra commentedHi PaoloN,
Thank you for your review and suggestions.
I have incorporated all changes except the test cases. I don't think that test cases are mandatory and could be a blocker. However I will add them at later stage.
Thanks,
Comment #24
PaoloN commentedHey mepushpendra !
No worries, all good.
By the way, all those points were mere suggestions, not blockers :)
I see you fixed the default branch, now the auto reviewer passes it.
All good :)
Comment #25
PaoloN commentedComment #26
mepushpendra commentedComment #27
mepushpendra commentedComment #28
mepushpendra commentedAdded Reviews of other projects section
Comment #29
misc commentedThanks for your contribution, mepushpendra!
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 #30
misc commented