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

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

Dependencies

Restrictions

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

mepushpendra created an issue. See original summary.

yogeshmpawar’s picture

Hi 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.

yogeshmpawar’s picture

Status: Needs review » Needs work

Hi mepushpendra,

Pareview.sh is giving following errors.

http://pareview.sh/pareview/httpgitdrupalorgsandboxmepushpendra2758273git

Will do a manual review in some time.

mepushpendra’s picture

Issue summary: View changes
Status: Needs work » Needs review

Please find the git command for non-maintainer

git clone --branch 7.x-1.x https://git.drupal.org/sandbox/mepushpendra/2758273.git private_notes

mepushpendra’s picture

Status: Needs review » Needs work
mepushpendra’s picture

Status: Needs work » Needs review

Thank you for your valuable suggestion. I have completed code changes as per the code review suggestion.
Please review once again.

PA robot’s picture

Multiple Applications
It appears that there have been multiple project applications opened under your username:

Project 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.

PA robot’s picture

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.

nixou’s picture

Hi 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 :

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

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 :

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).

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 :

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).

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.

nixou’s picture

Status: Needs review » Needs work
nixou’s picture

I 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.

mepushpendra’s picture

Status: Needs work » Needs review

Hi 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,

hardikpandya’s picture

Hi mepushpendra,

It would be good if you add dependencies in your info file.Rest your module seems ok.

Best Regards

visabhishek’s picture

@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"?

mepushpendra’s picture

Hi 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

yogeshmpawar’s picture

Status: Needs review » Reviewed & tested by the community

Manual 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.

naveenvalecha’s picture

Assigned: Unassigned » naveenvalecha
Issue summary: View changes

What is the usecase of the module. Can you add that in Readme.txt
Manual Review :

  1. Use project page template for the project page.
  2. Add hook_help in module.
  3. Use Readme.txt template for the module
  4. private_notes_uninstall: There's not need to explicitly remove the schema drupal_uninstall_schema('private_notes');
  5. pnid be the better primary key name than notenum

Assigning to myself to review it thorougly tonight

mepushpendra’s picture

Issue summary: View changes

Hi 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

naveenvalecha’s picture

Assigned: naveenvalecha » Unassigned
Status: Reviewed & tested by the community » Needs work

Manual Review :

  1. Why explicit rules(.PrivateNotes > .title ) in css file. pinged @Manjit.Singh for providing his thoughts on css.
  2. /**
     * @file
     * Install, update and uninstall functions for the blog module.
     */

    This comment needs update

  3. use proper commit messages https://www.drupal.org/node/52287
  4. use node_type_get_names() instead of
          $node_types = node_type_get_types();
          $options = array();
          foreach ($node_types as $type) {
            $options[$type->type] = $type->name;
          }
  5. Use default value with variable_get in function private_notes_show_on_node_type
  6. private_notes_menu : Use single quotes over double quotes wherever possible it will give performance hits as well.
  7. Add . after description '#description' => t('Your note should not exceed 512 characters'),
  8. private_notes_note_add_note_submit : Use menu_get_object over arg
  9. private_notes_delete_note_submit :Why are you setting variable in this function. if you are not using it then remove it b/c it will pollute the variable schema.
  10. Use Readme.txt template for the module
  11. Moving back to N/W due to open questions.

manjit.singh’s picture

@mpushpendra Thanks for contribution. :)

<div class="PrivateNotes">
  <div class="title">

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.

mepushpendra’s picture

Status: Needs work » Needs review

Hi Naveen,

Thanks for the detailed review. I have incorporated all changes as suggested by you & Manjit.
Please review again and do the needful.

PaoloN’s picture

Status: Needs review » Needs work

Hi 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

mepushpendra’s picture

Status: Needs work » Needs review

Hi 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,

PaoloN’s picture

Hey 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 :)

PaoloN’s picture

Status: Needs review » Reviewed & tested by the community
mepushpendra’s picture

Issue summary: View changes
mepushpendra’s picture

Issue summary: View changes
mepushpendra’s picture

Issue summary: View changes
Issue tags: +PAreview: review bonus

Added Reviews of other projects section

misc’s picture

Issue tags: -PAreview: review bonus

Thanks 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.

misc’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.