Description:
Node Notes provides a simple note system for select node types. The reason this was created instead of using core comments was to leave public comments available while keeping notes private for administrators.

Eventually, the permission hook will be expanded to "per content type" read/write granularity so that each role can be limited per content type instead of read/write on all content types.

Project page:
http://drupal.org/sandbox/tonylegrone/1281152

Git repo:
git clone --branch master tonylegrone@git.drupal.org:sandbox/tonylegrone/1281152.git node_notes

Drupal version:
7.x

CommentFileSizeAuthor
#10 drupalcs-result.txt5.11 KBklausi

Comments

Everett Zufelt’s picture

Status: Needs review » Needs work

Took a look, very clean code. Some suggestions.

1. In the template files consider removing the class and id attributes, and allowing these to be set in the template_preprocess_hook() functions. This will make your module more easily extended by others. You can use the default attributes_array, content_attributes_array and classes_array keys provided in $variables.

2. Also for created date, would be better to do the formatting in preprocess, so that the logic is removed from the template.

3. Perhaps a bit longer description in .info would be helpful

4. In function node_notes_confirm_delete you have a dependency on Comment module, buy referring to comment_confirm_delete, but you do not have the dependency in your .info file.

5. function template_preprocess_node_notes() has no content.

6. Some files are missing @file doc and some functions are missing doc block.

tonylegrone’s picture

Thank you very much for your feedback. I'll get started on the changes right away.

misc’s picture

The applicant has been contacted to ask if the application is abandoned.

tonylegrone’s picture

Sorry I have sent an update in so long.

I do not want to abandon the module. I've had several other project going on and the client I initially built this for has been on hold for a while.

I didn't know there was any kind of time restraint on submitting new modules, although I completely understand. Please allow me to make the requested changes and get this module back on track

Thanks,
Tony

misc’s picture

You could anytime submit new modules as sandbox projects, but to get full projects up on drupal.org there are a some rules, like:

After ten weeks with a status of needs work: the applicant may be contacted by a reviewer to determine whether the application was indeed abandoned. The action taken by the reviewer should be documented in the project application issue.

Here are some tips: http://drupal.org/node/1187664

If you have any questions, feel free to ask.

tonylegrone’s picture

Status: Needs work » Needs review

I have made the changes initially requested changes as well as a few others.

Here are my commit notes:
- Added better description in .info.
- Added @file blocks to .install, .admin.ind and pages.inc.
- Corrected various syntax recommendations from the coder module.
- removed dependency on comment module in node_notes_confirm_delete().

- Added remaining documention for several functions in .module.
- Moved format_date() from node_notes-note.tpl to preprocessor.
- Moved class name from node_notes-note.tpl to $classes_array in template_preprocess_node_notes_note().

morgothz’s picture

Status: Needs review » Needs work

Hi!
I found some errors in your sandbox project:

  • Primary, yo must work in other branch instead of master. This branch must cointain only README.txt file. See http://drupal.org/node/1127732.
  • You must describe module's functionality in README.txt, not only installation instructions.
  • Missing file doc comment in node_notes.module
  • All functions should be prefixed with your module/theme name to avoid name clashes. See http://drupal.org/node/318#naming (node_notes.module - line 6)
  • Remove TODO tags.
  • Hook node_type_delete() won't work. It must be prefixed with your module name. (node_notes.module - line 105)
  • Missing function documentation for node_notes_form(). (node_notes.module - line 109)
  • Submit button value must pass through t() function. (node_notes.module - line 125)
  • Return statement not necessary in form submit callback. (node_notes.module - lines 147, 177, 196)
  • Missing function documentation for node_notes_view(). (node_notes.pages.inc - line 7)

You must see Doxygen and comment formatting conventions (http://drupal.org/node/1354)

tonylegrone’s picture

Status: Needs work » Needs review

Hello morgothz, I have made the following changes:

  • Migrated all my work to the 7.x-1.x-dev branch and cleaned out the master branch.
  • Added description to the README.txt.
  • Added @file doc to node_notes.module.
  • Fixed function name mistake on hook_node_type_delete(). (thanks for catching that)
  • Added function documentation to node_notes_form().
  • Passed submit button value through t().
  • Deleted unnecessary return in submit handler.
  • Added function documentation for node_notes_view().

You said that in node_notes.module - line 6 I have not properly named my function, but it is _node_notes_menu_access(). I have seen this convention in many other modules on their access callbacks and I don't understand how this could be in danger of a conflict.

Why do I need to remove my TODO comments?

Thank you for your input.

tyler.frankenstein’s picture

Status: Needs review » Reviewed & tested by the community

Hello, I am a fellow applicant doing a review of your project application.

Automated Review

http://ventral.org/pareview/httpgitdrupalorgsandboxtonylegrone1281152git

Branch name should be 7.x-1.x instead of 7.x-1.x-dev

Manual Review

With a fresh Drupal 7 install on localhost I was able to setup 'node notes' for the Article content type. I used Devel generate to make a bunch of dummy articles. As user #1 I was able to add and delete notes from article nodes without problem. I then tried visiting node note paths directly as an anonymous user (without permission), and as an authenticated user (non admin) to make sure I wasn't able to access or delete node notes. The permissions worked as expected and the anonymous/authenticated user wasn't able to do anything.

I then granted authenticated users the ability to view node notes. I then logged in as a regular user (only the authenticated role) and was able to view node notes attached to article nodes. The 'Notes' local task menu tab showed up as expected and I was able to view the node note list. The delete button didn't show up, as expected.

Next, I granted authenticated users the ability to create node notes and revisited the articles as an authenticated user. Creating node notes worked as exptected. The authenticated user was not able to directly access the node note delete confirmation page, as exptected. And finally granting the administer node notes permission to the administrator user role allowed a dummy admin user to create/delete node notes as expected.

Additionally, I made copies of the two tpl.php files and dropped them into the Bartik theme templates directory, flushed the theme registry and made html modifications to each. The template files worked as expected.

Suggested Improvement(s):
cache_clear_all() in node_notes_confirm_delete_submit. I myself wouldn't want all my caches flushed just when a simple node note was deleted. Can this cache clear be more direct? I.E. Just clear the cache on the node, node notes.

Suggested Feature(s):
I'd like to have the ability to choose asc/desc order for the notes listing.

Conclusion:
Nice job on this module, the code is nice and clean, and easy to follow. The module worked as expected in all cases. The local task menu tab on node pages and the vertical tab fieldset on the content type edit form fit perfectly, right where one would expect when working with a drupal site.

klausi’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new5.11 KB

The following git branches do not match the release branch pattern, you should remove/rename them. See http://drupal.org/node/1015226

* 7.x-1.x-dev
  remotes/origin/7.x-1.x-dev

Review of the 7.x-1.x-dev branch:

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. Get a review bonus and we will come back to your application sooner.

manual review:

  • 'node-note/%/delete': you should use a menu auto loading place holder here. Then the page is only available if the note could be loaded and you do not have to check that yourself. node_notes_load() could be used for that.
  • node_notes_form_alter(): if you are specifically targeting one form you should use hook_form_FORM_ID_alter().
  • node_notes_save(): you should use drupal_write_record() instead of db_insert() here.
  • node_notes_save(): the access check should not be in the submit function. If the user does not have access the form should have never been displayed.
  • node_notes_view(): why do you need the foreach() loop? It just copies the $result array?
tonylegrone’s picture

Thank you tyler.frankenstein and klausi for your reviews.

I have made the following changes based on your feedback:

  • Corrected README lines over 80 characters.
  • Corrected trailing whitespace and EOF lines in several files.
  • Removed access check from save and delete handlers.
  • Removed needless foreach loop in node_notes_view().
  • Used menu auto loading placeholder for confirm delete page.
  • Replaced db_insert() with drupal_write_record() in node_note_save().
  • Removed clear_cache_all() from note delete.

I have also renamed my branch to 7.x-1.x. If this is still not the correct branch I should be working in, I think I'll need someone to spell it out clearly for me. I'm very new to using git (or any source control for that matter) and I've been unsure of the correct way to manage this project remotely.

Thanks again for your help.

tonylegrone’s picture

Status: Needs work » Needs review
nmudgal’s picture

Just out of curiosity, how this module is better/different than annotate module ?

Thanks

tonylegrone’s picture

Hi nmudgal,

I didn't know about the annotate module before you asked. I just installed the dev to try it out and here are the major differences that I could see...

  • My module has an easier UI (IMHO)
  • I have only one configuration option to enable notes for a node. For my client's purpose, there didn't need to be any other options.
  • Annotate doesn't seem to be themable. I made it a point to make my notes themable.
  • Annotations are an entity. I didn't make mine an entity because I had a limited time to build the module initially and the documentation on enties is lacking clarity so it was far quicker for me to keep it basic.
  • I don't believe that my notes can be enabled for anything except nodes. If they can, that's news to me.
  • The 7.x version of Annotate still has a few bugs. After adding an annotation, I was directed to a page that didn't include the tabs for the node I added it to. That forced me to find my way back to the node I was working on.
  • After adding an annotation and navigating to "node/%node/annotate". The list of notes includes only the note body. The body is a broken link to "node/[nid]"

It's my judgement that my module is farther along than Annotate based on usability and bugs. That said, their current dev is dated 2011-Oct-22, so they could be coming out with an update soon.

Have you tested my module for yourself to see what you think of it? I'm definitely open to suggestions.

Thanks,
Tony

nmudgal’s picture

Hmm that makes sense. I didn't quite get time, to try it myself though, can only comment more if I try. Just wanted to get an overview.
Well, except that, I suppose you can work on permissions/visibility of node depending on user roles, integration with views, taxonomy etc. so data can be aggregated in various forms, if needed.

Thanks

tonylegrone’s picture

My next big goal is to tackle views integration. If this module gets approved, I'll start working on that for version 2. I just started working with drupal in mid 2009 and the need to integrate my own modules with views hasn't come up yet.

Do you have an idea of how taxonomy integration could be useful?

I made this module initially for a client and it currently fits their needs so I didn't bother to add more features than they needed. Which is why I didn't make it an entity or expand the permission options beyond read/write.

scot.hubbard’s picture

Status: Needs review » Needs work

Quite a nice little module this one. Works very well and was very easy to set up.

There are still quite a few code standards error/warnings (see: http://ventral.org/pareview/httpgitdrupalorgsandboxtonylegrone1281152git for more info).

Also, I would be tempted, purely from a neatness point of view, to put the .tpl files in a "theme" sub-directory of the module and the .inc files in an "includes" sub-directory. This is not critical though.

tonylegrone’s picture

Hi scot.hubbard,

Thank you for your input. I have corrected the alphabetized css and much of the trailing whitespace.

Most of the whitespace referenced in that test is because of extra lines I added for readability. The whitespace holds the tab depth inside the functions and loops. I'd rather not remove that as it doesn't hurt anything.

I also moved the tpl files into a templates folder.

Thanks!

tonylegrone’s picture

Status: Needs work » Needs review
scot.hubbard’s picture

Status: Needs review » Reviewed & tested by the community

Hi Tony,

I understand that readability is good so completely see where you are coming from with the whitespace. I would however be tempted to clean it up.

Despite that I see no reason why this module should not go forward so have set the status to RTBC.

tonylegrone’s picture

Thanks Scot,

I have removed the other whitespace.

klausi’s picture

Status: Reviewed & tested by the community » Fixed

You have not listed any reviews of other project applications in your issue summary as strongly recommended in the application documentation.

manual review:

  1. "stylesheets[all][] = css/node_notes.css": why do you need your CSS on every page request? I thought your module is only related to nodes?
  2. node_notes.info: the description should be on one line.
  3. node_notes_permission(): permission titles must run through t() for translation.
  4. node_notes_delete(): $num_deleted is never used.
  5. node_notes_confirm_delete_page(): if you are just displaying a form on your page you can just directly use drupal_get_form as page callback in hook_menu() and remove that function.

But that issues are not critical blockers, so ...

Thanks for your contribution, tonylegrone! Welcome to the community of project contributors on drupal.org.

I've granted you the git vetted user role which will let you promote this to a full project and also create new projects as either sandbox or "full" projects depending on which you feel is best.

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.

As you continue to work on your module, keep in mind: Commit messages - providing history and credit and Release naming conventions.

Thanks to the dedicated reviewer(s) as well.

tonylegrone’s picture

Hi klausi,

Thank you so much! I'm really excited to finally get this module contributed to the community.

I have made all the changes you suggested. They were very helpful.

Thanks again!
Tony

Status: Fixed » Closed (fixed)

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