SideComments Now integrates SideComments.js and the Drupal core commenting system, allowing users to add comments to content on a per-paragraph basis.
It differs from the other SideComments.js module in that it:
- Is D7.
- Uses the Drupal core commenting system.
I attempted to contact the maintainer of SideComments.js and received no response.
Project page
https://www.drupal.org/sandbox/melvix/2633590
git clone command
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/melvix/2633590.git sidecomments_now
Manual reviews of other projects
https://www.drupal.org/node/2575389#comment-10671462
https://www.drupal.org/node/2609480#comment-10667668
https://www.drupal.org/node/2267323#comment-10665026
https://www.drupal.org/node/2574753#comment-10806168
https://www.drupal.org/node/2652208#comment-10806778
https://www.drupal.org/node/2565825#comment-10806866
Features:
Mollom Integration
Mollom content moderation can be applied to sidecomment submission by activating the Mollom module and applying it to the comment form for the content type you're working with.
Customizable theme CSS
Change the look and feel of the side comment interface by providing your own theme css file, replacing (not overriding) the default theme CSS file.
Customizable callback for users without commenting permissions
What should happen when a user attempts to submit a comment but they don't have permissions to do so? You may want to display a login dialog or redirect to the login screen, for example.
Customizable feedback
Customize the feedback that is returned when a comment is spam-filtered (using Mollom) or when it is submitted to the comment approval queue.
Granular control over paragraph commentability
Prevent comments from being applied to any paragraph by giving it the "non-commentable-section" class. You can also define your own non-commentable classes.
| Comment | File | Size | Author |
|---|---|---|---|
| #24 | coder-results.txt | 4.26 KB | klausi |
Comments
Comment #2
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxmelvix2633590git
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
melvix commentedAll the problems reported at http://pareview.sh/pareview/httpgitdrupalorgsandboxmelvix2633590git have been fixed.
Comment #4
melvix commentedComment #5
melvix commentedComment #6
melvix commentedComment #7
melvix commentedComment #8
markconroy commentedHi @melvix,
This looks really interesting. I'm a bit snowed under right now, but if I get a chance to install this later tonight I will.
It's the kind of module I could imagine being used on a lot of media sites.
Comment #9
andrewmacpherson commentedThe
<script>tag insidecomments-now-wrapper.tpl.phpappears to be a just a placeholder for some JS vars. Is this all the template is supposed to do? (i.e. is there a reason why a themer would expect to edit this template?)If the template is just a way to inject some JS vars, it is probably better to do it using the
Drupal.settingsJS API (see https://www.drupal.org/node/304258#drupal-settings). Inside your Drupal.behaviors JS you'll be able to accessDrupal.settings.sidecomments_now.sideCommentNid, instead ofwindow.sideCommentNid. The advantage of doing this is that you'll be able to dispense with the sidecomments_now_wrapper entirely.Comment #10
andrewmacpherson commentedThe other sidecomments module doesn't appear to have had much work done on it, just a stub module really. However it does appear that the author intends it to use the core comment module; it's listed as a dependency.
Comment #11
andrewmacpherson commentedSince this module lets an admin user add executable JS code, you probably want to use the
'restrict access' => TRUEoption in hook_permission().Comment #12
moshnoi commentedmaybe i have done something incorrectly while installing, but i got that error in console(i have installed side-comments from git):
side-comments.min.js?nzqero:1 Uncaught TypeError: this.$body.on is not a function
Drupal.behaviors.sidecomments_now.attach @ sidecomments_now.js?nzqero:16
(anonymous function) @ drupal.js?nzqero:76
b.extend.each @ jquery.js?v=1.4.4:33
Drupal.attachBehaviors @ drupal.js?nzqero:74
(anonymous function) @ drupal.js?nzqero:481
b.extend.ready @ jquery.js?v=1.4.4:30u @ jquery.js?v=1.4.4:38
Comment #13
feyp commentedAutomated Review
No automated tests, but this is not a requirement.
Manual Review
'restrict access' => TRUEfor your permission in hook_permission(), since you allow admins to add executable JS code to the page and this might be a security issue, if you don't trust those users.<a href="@link_url">Link title</a>'). See https://www.drupal.org/node/322774 for more info.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.
This review uses the Project Application Review Template.
Comment #14
melvix commented@markconroy, @andrewmacpherson, @moshnoi and @FeyP: Thank you for your feedback. I have updated the module based on your comments, which I will respond to below, more or less in order received.
I made the changes you suggested. Sidecomments javascript is now written to Drupal.settings and the template file eliminated.
I added an access callback for sidecomments_now/delete, checking for comment ownership or comment administrative privileges. Additionally, the callback compares the referer and the comment's node url, which should always be identical (preventing someone from accessing sidecomments_now/delete directly).
Added restrict access' => TRUE
Even though libraries module is a dependency, it might not be fully installed at the time that _sidecomments_now_get_library_path() is called (at install), resulting in an error.
Replaced exit() with drupal_exit().
I don't see a typo anywhere in this area. Can you elaborate?
I followed your example and changed !link to @link_url (inserting the url instead of the html link).
I added more documentation, but I did not see any that were missing info about return values specifically. Please let me know if you are referring to a specific function.
I fixed this by using field_language() to retrieve the correct body field language.
I added clarification to the Install instructions about using the master version. I believe this will also address the issue submitted by @moshnoi.
I changed the configuration notes in README.txt to address the WYSIWYG settings more specifically:
I added a placeholder image that will be displayed as the user picture if the user has no picture and the default user picture isn't set.
I am not able to reproduce this. If the user's comment has not been moderated and published, this might explain it.
Comment #15
melvix commentedRegarding the duplication with /project/sidecomments noted in #10 and #13, I have attempted to contact the maintainer again.
Comment #16
feyp commentedHi melvix,
thank you for addressing all the issues and also for giving credit in the commit messages. That's very nice.
I didn't do a full review this time, but instead reviewed the git commits made since the last review. I verify, that the issues I identified – especially the blocker/security issues – have been fixed. I also checked your project again using preview.sh and it found a few minor issues, but this doesn't block the application.
I really appreciate your effort trying to work with the maintainer of the sidecomments module. I said before, that I'd rather not block on this, but leave it for a maintainer of the project applications to decide, what to do here. So...
... in my view, this module is RTBC :).
Regarding your questions:
I was probably referring to this comment
// in a jsn object in the way that will make sidecomments.js happy., wherejsnshould readJSON, I guess. It's now on line 476.That's definitely an improvement! However, here are a few functions I was referring to:
Comment #17
melvix commentedI added @param and @return tags where they were missing, fixed the spelling error and a number of documentation formatting errors found by pareview.sh.
@FeyP, thanks for your review!
Comment #18
melvix commentedI was able to contact the maintainer of the SideComments.js module via Twitter. He has granted me commit access to his project and says:
I asked him if he planned on remaining the project maintainer and he said:
I am reluctant to "merge in all I have," for several reasons, the primary two being:
1. Communicating with the maintainer is difficult. (Does not respond to email, only Twitter.)
2. Merging my project into another at this point might not allow me to be granted permission to create full projects.
I am interested in any advice experienced members of the community have about how I should handle this.
Comment #19
klausiReview of the 7.x-1.x branch (commit a80ca14):
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:
Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #20
melvix commentedComment #21
melvix commentedComment #22
melvix commentedComment #23
melvix commented@klausi, thank you for your review.
I removed the implementation of hook_install(). It wasn't necessary.
Currently it only works on body fields. I added a note to that effect on the project page and to the README file.
I added tokens to sidecomments_now_save() and sidecomments_now_delete() to prevent CSRF attacks. Thank you for including the links in your note about this.
Manual reviews of 3 more projects:
https://www.drupal.org/node/2574753#comment-10806168
https://www.drupal.org/node/2652208#comment-10806778
https://www.drupal.org/node/2565825#comment-10806866
Comment #24
klausiReview of the 7.x-1.x branch (commit f4a9025):
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 otherwise looks good to me. Assigning to mpdonadio as he might have time to take a final look at this.
Comment #25
melvix commented@klausi, thank you again for your review and comments.
I did not know Drupal.checkPlain() existed! I removed escapeHtml() and replaced it with Drupal.checkPlain().
I added check_plain($comment->name).
During the install phase the libraries module is not necessarily installed yet. I want to prevent installation if the SideComments.js library is not found.
SideComments.js requires jQuery version 1.7 at a minimum because it uses jQuery.on(). I added a note about this in the README file and on the project page. I also changed admin-pages javascript so that it is compatible with jQuery version 1.4.4.
ESlint errors: The version of .eslintrc I am using is the one referenced here: https://www.drupal.org/node/1955232. I notice that it has one difference between it and the version I have in an installation of D8 - the D8 version has this line:
"quotes": [2, "single", "avoid-escape"],Which is the correct version to use?
Comment #26
klausiThe correct ESLint config version ships with Drupal core, I fixed the project page at https://www.drupal.org/node/1955232
So your module should depend on jquery_update module if you need a higher jquery version?
Comment #27
melvix commentedI updated my version of .eslintrc and replaced double-quotes with single-quotes in javascript files.
I didn't add jquery_update module as a dependency because I thought it would be nicer to allow the site admin to use whatever method they liked for setting jquery. I listed it under "recommended modules." Is requiring it a better approach?
Comment #28
klausino objections for more than a week, so ...
Thanks for your contribution, Dagwood!
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 #29
melvix commentedThanks klausi!
Comment #30
mpdonadio