Synopsis
The Better comments provide a facebook style simple comment system,
Ajax based comment form submission.
Option to add user picture to comment form.
Disable / enable the text filter options below comment form.
Disable / enable the subject box and author name box in comment form.
Disable / enable the preview button.
Ajax based preview of the comment.
Ability to disable the Comment body heading title.
Ability to allow a user to delete his own comment.
Cancel button on Preview and delete confirmation form.
The module is Ajax based somewhat similar to Ajax Comments, but it lacks in areas like preview of the comment, delete confirmation box with cancel options and some link enable disable feature on click. Other modules like Comment goodness provides the delete feature.
This module is intended to provide functionality like Facebook comment system. And some of it's feature may resemble with other comment modules as mentioned above. Future release may include some new features. New suggestions are always welcome.
Project link : Better Comments
Requirements
Comment module
Automated Review
http://pareview.sh/pareview/httpgitdrupalorgsandboxsamirmankar2342293git-7x-1x
Git Clone command
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/samir_mankar/2342293.git better_comments
Manual Reviews of other projects
https://www.drupal.org/node/2275511#comment-9176033
https://www.drupal.org/node/2279781#comment-9176085
https://www.drupal.org/node/2284061#comment-9176219
https://www.drupal.org/node/1545640#comment-9215037
https://www.drupal.org/node/2333405#comment-9215207
| Comment | File | Size | Author |
|---|---|---|---|
| #68 | coder-results.txt | 4.46 KB | klausi |
Comments
Comment #1
samir_mankar commentedComment #2
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 #3
gaurav.pahuja commentedAutomated Review
No. Some major issues reported on PAreview.sh. It seems that default branch is not set so PAreview is not able to review it correctly.
Best practice issues identified by pareview.sh / drupalcs / coder. Please don't copy/paste all of the results unless they are short. If there are a lot, then post a link to the automated review and mention that problems should be addressed.
Manual Review
Avoid hook_init. There are multiple efficient ways to include JS / CSS instead of using hook_init. MYTHEME_preprocess_node can be used.
Syntax is incorrect for function hook_form_FORM_ID_alter
Check correct syntax here https://api.drupal.org/api/drupal/modules%21system%21system.api.php/func...
Some commented code is there in tpl files.
hook_help doesnt provide any information about the module.
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.
I will play with this module on a Vanilla Drupal installation and let you know in case I get any issues.
Comment #4
samir_mankar commentedThanks for your suggestion, following changes as suggested by you has been made.
README file updated as per drupal standards.
Avoid hook_init. : Css file is now added through .info file and the hook_init function has been been removed.
the other option was hook_preprocess_node(), but right know we don't need to limit to node only. This change or any suggestion may be updated in future updates.
hook_form_FORM_ID_alter : Currently not using this hook for fom alter as i am not using any switch cases to for multiple forms which seems fine to me.
Lastly any suggestions are most welcomed.
Comment #5
ajitsThank you for the contribution Samir!
Automated reviews
PAReview didn't through any errors.
Manual review
system_settings_formshould be deleted inhook_uninstall()in a install file of the module. Naming conventions of the variables follow the standards.I didn't install the module and check the functionality. I'll do it when these issues get resolved. This certainly looks like a useful module.
Comment #6
samir_mankar commentedComment #7
samir_mankar commentedComment #8
samir_mankar commentedThanks for suggestion Ajit!
All the point mentioned by have been corrected and the updated code has been committed.
Any new suggestions are most welcome.
Comment #9
samir_mankar commentedComment #10
samir_mankar commentedComment #11
klausiGit default branch is not set, see the documentation on setting a default branch.
It appears you are working in the "7.x.1.x" branch in git. You should really be working in a version specific branch: 7.x-1.x. The most direct documentation on this is Moving from a master branch to a version branch. For additional resources please see the documentation about release naming conventions and creating a branch in git.
See also: http://pareview.sh/pareview/httpgitdrupalorgsandboxsamirmankar2342293git...
Comment #12
samir_mankar commentedComment #13
samir_mankar commentedThe code has been updated and all warnings and notices has been corrected. Except the below three:
- Instead of theme($image) , theme_image($image) is currently being used, as theme() function needs logged in user. Currently the code allows to show a default image for anonymous user.
469 | WARNING | Do not use the raw $form_state['input'], use | | $form_state['values'] instead where possible
- $form_state['input'] is been used instead of $form_state['values'] because we need to clear some of the user input when setting 'rebuild' the form.
Any other suggestions are most welcome.
Comment #14
samir_mankar commentedComment #15
devd commentedfunction better_comments_form_comment_form_alter(&$form, &$form_state, &$form_id);
$form_id should be called as pass by value.
Ref: https://api.drupal.org/api/drupal/modules!system!system.api.php/function...
Comment #16
samir_mankar commentedThanks for suggestion @devendra.yadav.
The above mentioned bug has been corrected and commited.
Thanks
Comment #17
samir_mankar commentedComment #18
alokvermaei commentedHI,
Thanks for this awesome module.Please have a look on the below mentioned points.
1. i have used coder module for review and got a mini problem in it.(attached in the screen shot)
2. When there is no image assigned then it took extra space in the comment.attached in the screenshot.
3. It will be good if you will give an on/off option to use better option on the form page.
Comment #19
alokvermaei commentedHI,
Thanks for this awesome module.Please have a look on the below mentioned points.
1. i have used coder module for review and got a mini problem in it.(attached in the screen shot)
2. When there is no image assigned then it took extra space in the comment.(attached in the screenshot.)
3. It will be good if you will give an on/off option to use better option on the form page.
4. please review the code on http://pareview.sh/pareview/httpgitdrupalorgsandboxsamirmankar2342293git . and fix all the issues.
Comment #20
alokvermaei commentedComment #21
samir_mankar commentedThanks for the suggestion @alokvermaei.
1. Coder module issues fixed.
2. When no image assigned issue fixed.
3. I am not clear what is your suggestion (on/off option to use better option on the form page).
4. Issues have been fixed. http://pareview.sh/pareview/httpgitdrupalorgsandboxsamirmankar2342293git .
For the below three warnings please refer comment #13 above.
Comment #22
samir_mankar commentedComment #23
samir_mankar commentedComment #24
samir_mankar commentedComment #25
samir_mankar commentedComment #26
samir_mankar commentedComment #27
samir_mankar commentedComment #28
pushpinderchauhan commentedPlease don't RTBC your own issues, see the workflow: https://www.drupal.org/node/532400.
Please treat these rules with understanding and be patient.
Comment #29
mccrodp commentedAutomated Review
Submitted by Anonymous (not verified) on Mon, 09/22/2014 - 17:59 Git default branch is not set, see the documentation on setting a default branch. Review of the 7.x-1.x branch (commit be2abf6): DrupalPractice has found some issues with your code, but could be false positives. FILE: /var/www/drupal-7-pareview/pareview_temp/better_comments.module -------------------------------------------------------------------------------- FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES -------------------------------------------------------------------------------- 136 | WARNING | Do not call theme functions directly, use theme('image', ...) | | instead 349 | WARNING | Do not use the raw $form_state['input'], use | | $form_state['values'] instead where possible 471 | WARNING | Do not use the raw $form_state['input'], use | | $form_state['values'] instead where possible -------------------------------------------------------------------------------- Time: 138ms; Memory: 10.5Mb 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.theme('image', $picture)as it suggests?$form_state['input']for?Can you not change this to
$form_state['values'] = array()?Manual Review
Perhaps give even further detail of the difference between your module and other comment related contrib modules specifically.
There are many comment modules, what does yours do differently that other modules don't do?
Are none of the features you mention provided by any of the below?
follow the guidelines for master branch.
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.
This review uses the Project Application Review Template.
Comment #30
samir_mankar commentedThanks for the reply @mccrodp.
All bugs mentioned by have been fixed.
The only thing the auto review is showing is
Drupal returns the cached form with text in textearea. That is why $form_state['input'] is being used instead of $form_state['values'] to get the empty text form.
I hope this answers the question. any new suggestions are most welcome.
Comment #31
anfor commentedHi,
1/ Your callback function better_comments_menu should have parameters $form and $form_state because the function pasted through drupal_get_form.
2/ When I checked all options in the administration form, the render of the comment form went weird (see the file).
3/ One variable_get in administration page isn't named properly.
Line 35 of file better_comments.admin.inc
'#default_value' => variable_get('better_commentss_author', 0),should be
'#default_value' => variable_get('better_comments_author', 0),4/ Functions that implements a hook should have in their description Implements hook_NAME
(e.g : better_comments_comment_view())
And you should add parameter details in your custom functions description.
Regards,
Antoine
Comment #32
samir_mankar commentedThanks @anfor for your review.
1. $form and $form_state are not used as passing it causes some functions to work incorrectly.
2. The css issue has been fixed now. The comment form with or without picture displays correctly in Garland and bartik theme. Though extensive checking is need with other themes also.
3.The variable name has been fixed.
4. Hook implementation comment has been added.
Thanks...
Comment #33
samir_mankar commentedComment #34
sumitmadan commentedDisable Comment subject textboxsetting as there is already with each content type.Show user picture beside comment boxoptions is disabled?Disable text filter format options below comment box.option too. Because we can set the comment body as plain text inComment Fields Settings.Disable the Preview buttonsetting too as there is already with each content type.Comment #35
samir_mankar commentedComment #36
samir_mankar commentedComment #37
nomorecaptcha commentedBetter Comments Module Review
Master Branch
Not sure. But it follows the guidline for master branch provided by drupal.org.
3rd party code
It follows the guidelines for 3rd party code.
README.txt/README.md
Yes. It has the Readme.txt file and following the readme template.
Duplication
There is another same module but that module is providing some different set of features. So it is not violating the duplication terms and conditions.
Individual user account
It provides individual user accounts and is following guidelines provided by drupal.org
Licensing
It follows the licensing requirements.
Secure code
Security is not up to the mark needs some more validation.
Code long/complex enough for review
Module is following the guidelines of code complexity and length.
Help
Hook_help does not provide enough information of the Module.
Code Issues
better_comments.module
<div class="comment-user-picture">' . theme('user_picture', array('account' => $picture)) . '</div>';;PR review
Here is the PR Review
Comment #38
pingwin4eg@samir_mankar
The branch names of your project confuse people. Please, do something with the branch 7.x.1.x:
new-features7.x-1.x-new-featuresComment #39
samir_mankar commentedComment #40
samir_mankar commentedThanks @pingwin4eg,
The branch 7.x.1.x has been removed from the repository.
Now 7.x-1.x is the default branch.
Following is the PR Review. for branch 7.x-1.x.
For The two warnings please see the above comment #21. and the other reason for not using the $form_state['values']
is, it return node data or content with it. That is why $form_state['input'] is used.
As reviewed by @nomorecaptcha,
1. The Help function has been removed as of know, as it is not need.
2. Line: 140 String concatenation hass been corrected.
Comment #41
mpdonadioAssigning to myself for next review.
Comment #42
jepster_Automated Review
FILE: /var/www/drupal-7-pareview/pareview_temp/better_comments.module
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------
360 | WARNING | Do not use the raw $form_state['input'], use
| | $form_state['values'] instead where possible
486 | WARNING | Do not use the raw $form_state['input'], use
| | $form_state['values'] instead where possible
Manual Review
This review uses the Project Application Review Template.
Comment #43
jepster_*status update*
Comment #44
mpdonadio@jepSter, do you consider the PAReview warnings blocking issues per the comment #40? Did you manually review the usage? PAReview not coming up clean isn't, by itself, a reason to send a project back to Needs Work.
Comment #45
jepster_I've took a closer look on your module.
There are dozens of similar ones. A very basic google search: https://www.google.de/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-...
Your module isn't multi-language ready.
That's bad coding style. You shouldn't work directly with the values and additionally not in that nested level. May you take a look on https://www.drupal.org/node/1797072 and https://www.drupal.org/documentation/entity-metadata-wrappers.
Also your project page is "thin". Please read the following page for an appropriate project page: https://www.drupal.org/node/997024.
Putting your project back to "Needs work".
Comment #46
samir_mankar commentedThanks for review @jepSter.
1. This code is perfectly fine, as the above code checks weather the field is empty or not. Secondly the metadata wrapper cannot be used here in $form_state. Thirdly the above code does not effect the translation as it is for validation.
2. All the other comment modules not same as this one as you can read all the other comments above mentioned it. The other comment modules does not provide the same functionality as this module.
3. As mentioned by @mpdonadio #44 comment please refer the comment 40 for form_state[input] warning.
Thanks.
Comment #47
samir_mankar commentedComment #48
mpdonadioReassigning back to myself; I was midway through reviewing this.
Comment #49
mpdonadio(Note it looks like there were updates and reviews since I had assigned this to myself; some of mycomments may be out of date.)
Automated Review
Review of the 7.x-1.x branch (commit 20c2fd3):
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
(*) Looks like $items['better_comments/edit/%/cancel'] should not 'access content' permission, as direct access may lead to access bypass problems.
Maybe 'edit own comments'? It looks like 'access content' is wrong on almost all of those menu items.
(+) You behavior needs to use the context that was passed to it in the jQuery selectors.
(+) In better_comments_settings(), don't break translated strings across lines. This makes translation difficult. This
is a valid warning to ignore form PAReview.
Rather than including the CSS and JS on every page by specifying it in the .info file, you should use #attached, probably in the comment forms.
The permission on $items['better_comments/%/edit'] looks wrong. You are not defining 'comment_access'
(+) better_comments_form_comment_form_alter implements hook_form_BASE_FORM_ID_alter().
In better_comments_form_comment_form_alter(), I am not sure if LANGUAGE_NONE is appropriate. There should be a proper language set in either $form or $form_state that you can use.
(*) better_comments_reply() shouldn't do the access check. You should define a new access callback for this menu entry, and use that instead.
(+) better_comments_reply() and elsewhere, #markup should avoided; use proper renderable elements.
better_comments_confirm_delete_submit(), the cache_clear_all() is a little extreme. You should just be able to delete the proper entries in {cache_page}
(+) Removed dead code in better_comments_comment_view_alter().
I think the $form_state['input'] warnings can be ignored, as you aren't actually using the unsanitized values anywhere.
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 #50
samir_mankar commentedThanks @mpdonadio for the review.
1. $items['better_comments/edit/%/cancel'] access content has been updated with the edit own comments permission.
2. better_comments_settings() description strings has been corrected for translation.
3. The permission of $items['better_comments/%/edit'] has been updated to edit own comments.
4. In the better_comments_confirm_delete_submit() function, the cache_clear_all() has been been removed.
5. The dead code has been removed.
6. Adding css and js through #attached will look in to it, as the css and js code is used for both comment form and comments displayed or delete form.
7. The cache clear for delete has been removed and the reply form acces check has been update.
Thanks.
Comment #51
mpdonadio@samir_mankar , if/when you think this is ready to be looked at again, set the status to Needs Review.
Comment #52
samir_mankar commentedComment #53
samir_mankar commentedComment #54
mpdonadioAssigning to myself for next review, which should be tonight.
Comment #55
mpdonadioReview of the 7.x-1.x branch (commit 5feecc7):
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
(+) You behavior needs to use the context that was passed to it in the jQuery selectors.
(+) better_comments_form_comment_form_alter implements hook_form_BASE_FORM_ID_alter().
(+) The final if() in better_comments_comment_view_alter() is still dead code. $prefix will never be used; you already used it above;
(*) better_comments_reply() still has access checks and will return menu codes. This should be handled by an access check on the menu item; not in the menu callback itself.
Security issue looks better, but the (*) issue above is a failry big API problem.
And (*) Unsure: Does not cause module duplication and/or fragmentation. Please outline differences between this and other similar projects in the summary and on the project page.
Comment #56
mpdonadioComment #57
samir_mankar commentedThanks @mpdonadio
The following issues has been fixed.
(*) better_comments_reply() access checks has been fixed.
(+) jQuery selectors context passing has been fixed.
(+) better_comments_form_comment_form_alter fixed.
(+) The final if() in better_comments_comment_view_alter() has been removed.
Thanks.
Comment #58
samir_mankar commentedComment #59
samir_mankar commentedComment #60
pingwin4egPlease don't remove the security tag, we keep that for statistics and to show examples of security problems.
Comment #61
samir_mankar commentedThanks @pingwin4eg.
I am glad that you pointed for PARsecurity tag. I really appreciate that, but why not also review the code, it would help me and our community as well.
Thanks.
Comment #62
nomorecaptcha commentedWe have reviewed (i.e. PR reviews and manual review both) this module earlier, now we have tested again and found following errors:
File: @file block missing (Drupal Docs) [comment_docblock_file]Comment #63
samir_mankar commentedThanks @nomorecaptcha.
1. Line 262 missing space has been fixed.
2. The @file block is there in the better_comments.js. I have checked it.
Comment #64
klausiremoved automated review.
Comment #65
klausiThis sounds like a feature that should live in the existing ajax_comments project. Module duplication and fragmentation is a huge problem on drupal.org and we prefer collaboration over competition. Please open an issue in the ajax_comments issue queue to discuss what you need. You should also get in contact with the maintainer(s) to offer your help to move the project forward. If you cannot reach the maintainer(s) please follow the abandoned project process.
If that fails for whatever reason please get back to us and set this back to "needs review".
Differences to the following modules are also missing on the project page:
https://www.drupal.org/project/comment_goodness
https://www.drupal.org/project/comment_plus
https://www.drupal.org/project/ideal_comments
https://www.drupal.org/project/advanced_comment
I'm not sure how yet another comment improving module would help users when there are already so many existing modules out there that can be improved.
Comment #66
PA robot commentedClosing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #67
samir_mankar commentedsorry for replaying late, was busy with some other projects.
1. Modules: Comment plus and Advancecomment are the drupal 6 modules and not Drupal 7 so they are out of question.
2. Ajax Comment is based on per content type option , to select which content type will use ajax comments.
3. The better comments module customizes or alters the comment form once and will look the same no matter what content type it is seen or used in views.
4. Ajax comments relies on some other module to customize the look, my question is why installed another module if a single module can provide all the required features.
5. Finally the purpose and idea of this module was to provide a social media like comment system, example: Infibond.
6. I am sorry to say but Ajax Comment failed to work in Infibond site as this site is using Statuses (Social Microblog) for posts, as i developed the core for Infibond .
Comment #68
klausiReview of the 7.x-1.x branch (commit 8147dd0):
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 that are not critical application blockers, otherwise looks RTBC to me. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Assigning to mpdonadio as he might have time to take a final look at this.
Comment #69
mpdonadioAutomated Review
Review of the 7.x-1.x branch (commit 8147dd0):
(not reiterating the results from #68)
Manual Review
Agree with comments in #68.
In better-comments.tpl.php, you have a variable_get(). It is best to move that to a preprocess function and pass in a boolean for use in the template.
You have a bunch of variable_get() w/o a default value. It is best to provide one.
Otherwise nothing jumped out at me that would block this application.
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 #70
mpdonadioThanks for your contribution, samir_mankar!
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 #71
samir_mankar commentedThanks @mpdonadio i have fixed all the issues mentioned by you and Klausi except callbacks to a dedicated *.pages.inc file.