Version: Drupal 7.x
Description
Module provide option to update comment configuration for existing nodes(if any exist).
When configuration for any content type updated for comments, its applicable only for future nodes.
There is no option which can take care and confirm that latest comments configuration set to existing/old nodes.
This module provide option on content type edit form, under comment section, where Administrator can run batch to apply new comment configuration for existing nodes if required.

How to use

  1. Logged in as "Administrator" OR user account who is having access to edit/update content type configuration.
  2. Travel to "Structure » Content Types » Any content type EDIT page.
  3. Inside vertical tab "Comment settings" look for checkbox option with title "Update comment configuration for existing nodes".

Project page: Comment Bulk action

GIT Access: git clone --branch 7.x-1.x http://git.drupal.org/sandbox/tusharbodke/2551319.git comment_bulk_action

Reviews of other project applications done by me
PasswordResetTabs

Comments

tusharbodke created an issue. See original summary.

Sumit kumar’s picture

Your git command is not working please uncheck the maintainer checkbox in version control tab and then click on show button
: :- you find the right git command

Sumit kumar’s picture

StatusFileSize
new10.6 KB

For reference see the attached screenshot

tusharbodke’s picture

Hi Sumit,

Updated sandbox for maintainer checkbox.
Can you please try one more time?

tusharbodke’s picture

Issue summary: View changes
Vignesh Puliyadi Raja’s picture

Automated Review

issues found in pareview, need to be fix.

http://pareview.sh/pareview/httpgitdrupalorgsandboxtusharbodke2551319git

Manual Review

Coding style

Line no: 97 when using node_load its affecting the site performance[its fetching all the node informations]. so if you want node title field, write query for that.

You should also really have a hook_help() with some basic info about the module.

tusharbodke’s picture

Hi Vignesh,

Thanks for your review.

Automated review - Done with code clean up and matching Drupal standards as per http://pareview.sh/.
Manual Review - Batch process need to update each node configuration for comments which is only possible by loading node. I am not doing anything related to Node Title.
Also implemented HOOK_help().

Thanks again

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.

makbul_khan8’s picture

Hi Tushar,

I installed, tested and ran through your code. Everything looks great! This can be used for all nodes migrated from other platform to drupal, where we have comments active/disabled/hidden.

Was looking for this functionality for my previous project.

Reports

Online Automated testing report
http://pareview.sh/pareview/httpgitdrupalorgsandboxtusharbodke2551319git

Code is clean.

Manual review result:
Individual user account
Yes
No duplication
Yes
Master Branch
Yes
Licensing
Yes
3rd party assets/code
Yes
README.txt/README.md
Yes
Code long/complex enough for review
Yes : Code is long enough for review.
Secure code
Yes : Looks secured
Coding style & Drupal API usage
Yes : Looks good and follows drupal coding standards.

Thanks for your contribution.

makbul_khan8’s picture

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

Hi Tushar,
Thank you for submitting this application. Quite small yet nifty module!

I found a similar module, https://www.drupal.org/project/bulk_apply_comment_settings , which does that same thing. It has no releases, but the git repo contains code that works. That code however, appears to handle loads of nodes efficiently by splitting it to smaller chunks.

- While enabling the module, the module was downloaded to comment_bulk_actions, but the module's name is comment_bulk_action. Please rename the folder name to remove the trailing "s" to prevent confusions.

- In comment_bulk_action_update_node_comment_configuration(), its second argument seems to be the comment enabled status. But the batch process does not send the user-submitted value to that function.

array(
          $nid,
          t('(Operation @operation)', array('@operation' => $operation_count++)),
        ),

See the second array key above.

- Unset $_SESSION['http_request_count'] in the finished

tusharbodke’s picture

Status: Reviewed & tested by the community » Needs review

Hi Ayesh,
Thanks for review feedback.

Here is following changes implemented
1) Updated code to handle node load in chunks. Also saw code from module https://www.drupal.org/project/bulk_apply_comment_settings. Instead of fetching 5 node ids with DB query in each pass, My module fetching all node ids at once(avoid multiple DB query in each pass).

2) Yes, updated module folder name by removing unwanted 's'.
3) Added arguments for batch operations.
4) Done unset $_SESSION['http_request_count'] in the finished.
Thanks again for valuable inputs.

tusharbodke’s picture

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

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

StatusFileSize
new21.04 KB

Hi tusharbodke,

Thanks for your contribution,
when we click on help link , I did not see any text after click on help.
As you Implements hook_help().

function comment_bulk_action_help($path, $arg) {
  $help = NULL;
  switch ($path) {
    case "admin/help#comment_bulk_actions":
      $help = t("This module provide option on content type edit form,
      under comment section,
      where Administrator can run batch to apply
      new comment configuration for existing nodes if required.");
      break;
  }
  return "<p> {$help} </p>";
}
tusharbodke’s picture

Hi Sumit,

Sorry last time I removed unwanted "S" from module name OR parent folder, But forgot to update in HOOK_Help().

Update help link to match module, Can you please have look once again.

Thanks for feedback.

darol100’s picture

Status: Needs review » Needs work

Automated Review

Pareview.sh does not show any errors - http://pareview.sh/pareview/httpgitdrupalorgsandboxtusharbodke2551319git

Coder modules does not show any errors.

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 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 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
List of identified issues in no particular order. Use (*) and (+) to indicate an issue importance. Replace the text below by the issues themselves:
  1. This project name does not match with the modules name. Just like #11 mention. You should either rename your project name without the S or add S to your entire project.
  2. You hook_help nor you README.txt have any information on how to use this module. I spend like 15 mins trying to figure out how to use it and I couldn't until I read the summary description in this issue. You should add the same instructions that you have on you summrary description (How to use) and provide that information on hook_help and README.txt.
  3. In your project page, you should move the project pictures from attached files into Images field. This will display the pictures in the project page.

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.

I think the only blocker is lack of documentation. Add the documentation on "How to use" in the README.txt, hook_help and if you can on the project page. The module works like charm but if there instruction how to use it can be useless.

tusharbodke’s picture

HI darol100,

Thanks for your feedback/review.

1) Updated module name and remove unwanted "s".
2) HOOK_help and README.txt is updated for "HOW TO USE".
3) Project Image attached to project page which can help to understand how to use module.

Please have a look.

tusharbodke’s picture

Status: Needs work » Needs review
rashid_786’s picture

Thanks for your contribution, as i tested this module and it is working fine for me. However i think the help content

/**
 * Where?
 *
 *  Alter NODE TYPE EDIT form,
 * Where admin can select to apply comment configuration.
 *
 *  How?
 * 1) Implement batch to load and save node with new comment configuration.
 */

which you mentioned at the top inside .module file should be removed because you already had this content inside hook_help() and readme.txt to avoid the repetition.

tusharbodke’s picture

Hi Rashid,

Thanks for your feedback.
Yes you are right, Update module to remove unwanted comments.

Regards,

tusharbodke’s picture

Hi Rashid,

Thanks for your feedback.
Yes you are right, Update module to remove unwanted comments.

Regards,

rashid_786’s picture

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

Status: Reviewed & tested by the community » Needs review

Hi Rashid,
Can you please add complete review as per standards?
For more details please check #17.

Then you can mark status as "Reviewed & tested by community".

Thanks

rashid_786’s picture

Automated Review

No error found in automated review: http://pareview.sh/pareview/httpgitdrupalorgsandboxtusharbodke2551319git

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.
README.txt/README.md
[Yes] follow 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. / No: List of security issues identified.]
Coding style & Drupal API usage
[List of identified issues in no particular order. Use (*) and (+) to indicate an issue importance. Replace the text below by the issues themselves:
All looks good to me, however some observations mentioned below:
  1. +You declared variable $chunk_size = 5;, why it was supposed to have value as '5' or it might be defined at the Top as constant variable.
  2. +Instead of using db_query("SELECT nid FROM {node} WHERE type = :node_type ORDER BY node.nid ASC", array(':node_type' => $node_type))->fetchAllAssoc("nid"); it might be used pdo based query e.g. db_select()->condition->fetchAllAssoc.

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.

tusharbodke’s picture

Thanks Rashid for review.

Here is my updates regarding your suggestions.

1) Done with changes, CHUNK_SIZE constant added at top. thanks.
2) I did use static query(db_query) with purpose, instead of db_select(). PDO queries are heavy & mostly for conditional OR for long query statements.

Thanks

dishabhadra’s picture

Status: Needs review » Needs work

Coder Sniffer has found some issues with your code (please check the Drupal coding standards).
FILE: /var/www/drupal-7-pareview/pareview_temp/comment_bulk_action.module
---------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
---------------------------------------------------------------------------
5 | ERROR | There must be exactly one blank line after the file comment
8 | WARNING | All constants defined by a module must be prefixed with the
| | module's name, expected "COMMENT_BULK_ACTION_CHUNK_SIZE"
| | but found "CHUNK_SIZE"

tusharbodke’s picture

Hi Disha,

Thanks for your review feedback.

Updated code changes based on your suggestions, Will be great if you can add complete review for module.
Looking forward to hearing from your end.

Thanks,

tusharbodke’s picture

Status: Needs work » Needs review
tusharbodke’s picture

tusharbodke’s picture

makbul_khan8’s picture

Priority: Major » Minor
StatusFileSize
new2.84 KB

Hi Tushar,

I have tested your module again and it works fine. Looked on coding standards for you module and found 1 sniff, so fixed that with some changes on help comments.
Hope this will help developers to debug the exact functionality of this module.

Created patch for this comment_bulk_action-coding_standard_and_help_comments-2554401-32.patch

FILE: ...sites/all/modules/comment_bulk_action/comment_bulk_action.module
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
 5 | ERROR | [x] Doc comment short description must be on the first
   |       |     line
 6 | ERROR | [ ] There must be exactly one blank line after the file
   |       |     comment
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
tusharbodke’s picture

Thanks Makbul.
Patch has been has been merged.
Thanks

dishabhadra’s picture

TimRutherford’s picture

Automated Review

All good here.

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
  1. comment_bulk_action.module: line 138-143, seems to be missing indentation

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.

Other than the 1 minor issue, its looking good!

tusharbodke’s picture

Issue summary: View changes
tusharbodke’s picture

Hi TimRutherford

Thanks for review.
Updated code as per standards and your suggested.
Thanks for pointer.

adam_’s picture

Status: Needs review » Reviewed & tested by the community

Individual User Account?
Yes: Follows the guidelines for an individual user account.
No duplication?
No: I don’t see a published module that does this exact thing.
Master Branch?
Yes: Master branch is set.
Licensing?
Licensing looks correct.
3rd party assets/code?
No, I don’t see any 3rd pary assets or code.
README.txt/README.md?
README.txt is present.
Code long/complex enough for review?
Yes, follows the guidelines for project length and complexity.
Secure code?
Everything looks like it’s being run through sanitation and
Coding style & Drupal API usage? The general coding style looks good and syntax looks great.

Recommendation: Line 74 where the progress_message is being assigned a value in comment_bulk_action.module looks like it has replacement tokens, but no values are being passed in (@current, @total).

I tested the module out and it worked for me, I could definitely see myself using this. Very convenient.

Marking as Reviewed & Tested by the Community

damienmckenna’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for your contribution, Tushar!

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.

Status: Fixed » Closed (fixed)

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