This is an administrative helper module to allow users to apply comment settings to all nodes of a certain type when editing the settings for that content type.
This is an alternate, and simpler, solution to the one often found online (D.O and Drupal Answers) to use the Views Bulk Operations module, which is quite a lot of work, especially for an administrator editing multiple content types
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/TomCLopez/2331441.git bulk_apply_comment_settings
Reviews of other projects:
https://www.drupal.org/node/2333151
https://www.drupal.org/node/2333347
https://www.drupal.org/node/2331299
Comments
Comment #1
t-loComment #2
darrenwh commentedHi Tom,
Found a few issues on http://pareview.sh/ here:
http://pareview.sh/pareview/httpgitdrupalorgsandboxtomclopez2331441git
Darren
Comment #3
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 #4
ashley george commentedI installed the module from Git link above, turned it on, went to the comment section for an existing content type, checked the 'Bulk Apply Comment settings', hit Save. I received the following error:
Additionally, the same thing happens with all content types on my test site.
Comment #5
t-loThanks @darrenwh, I've gone through and sorted all the issues picked up by http://pareview.sh/
http://pareview.sh/pareview/httpgitdrupalorgsandboxtomclopez2331441git
@Ashley George I can't replicate that issue on the current version. I think it was intorduced and fixed by the work I was doing on the previous issue, sorry about that!
Comment #6
ashley george commentedI have re-installed and am not getting the error. Great job @T-Lo!
Comment #7
markpavlitski commented@T-lo this module looks really great!
Just one suggestion, I'd recommend using the batch API to process the comment changes. So that you won't run into issues when scaling to large numbers of nodes.
https://www.drupal.org/node/180528
https://api.drupal.org/api/drupal/includes!form.inc/group/batch/7
Comment #8
t-loThanks for the suggestion Mark, I'll make that change now.
I'm also switching from using db_updates to node_load and node_save so as to trigger any cache or other drupal hooks.
Comment #9
t-loThanks for the suggestion Mark, I'll make that change now.
I'm also switching from using db_updates to node_load and node_save so as to trigger any cache or other drupal hooks.
Comment #10
t-lothe change to use the Batch API is done
Comment #11
pushpinderchauhan commented@T-lo, thankyou for your contribution!
Automated Review
Best practice issues identified by pareview.sh / drupalcs / coder. None. Good Work
Manual Review
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.
First point looks blocker to me, preventing RTBC. Other than this module looks good to me, appreciate your module idea.
As I am not a git administrator, so I would recommend you, please help to review other project applications to get a review bonus. This will put you on the high priority list, then git administrators will take a look at your project right away :-)
Thanks Again!
Comment #12
t-loHi er.pushpinderrana,
Thanks for your detailed review.
I've sorted the following issues:
added hook_help
sorted out the batch API implementation
As for the changing module weight, this as to ensure that my hook ran after the comment modules hook.
If there's a better way to achieve that I'd be happy to change it!
Comment #13
t-lofurther to the above, I've been experimenting with using hook_module_implements_alter to change the order that the hook_form_FORM_ID_alter is called, but it doesn't seem to have any effect.
(I've been able to make similar changes to a hook_form_alter but not hook_form_FORM_ID_alter)
Comment #14
t-loJust spotted the following hint, so I'm trying again!
https://api.drupal.org/api/drupal/modules%21system%21system.api.php/func...
Comment #15
t-loI've managed to get the hook_module_implements_alter working and have removed the weight change from the module.
Comment #16
t-loComment #17
t-loAdded review bonus as I've reviewed 3 other modules
Comment #18
pushpinderchauhan commentedAssigning to myself for next review.
Comment #19
pushpinderchauhan commentedAutomated Review
Review of the 7.x-1.x branch (commit c04325a):
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
My blocking issues from #11 have been addressed, batch api code looks good.
Correct
admistratorspelling in Readme, also make it similar to README Template.Else Project page and Doc/comments looks good to me. Good Work!
Nothing major jumped out at me, also removing single project promotion tag as now module having 5 functions and source code is 124 lines long that makes you eligible for "create full projects" permission :).
I am not seeing any blocking issues. Assigning to mpdonadio for a second look if he has time, in past he also posted resolution for same http://drupal.stackexchange.com/questions/26224/mass-node-update-e-g-dis....
Comment #20
mpdonadioAutomated Review
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
The limit in the batch should really be a variable, preferable exposed via a setting form.
The docblock for bulk_apply_comment_settings_batch_update_nodes() should mention that it is the batch callback.
bulk_apply_comment_settings_batch_update_nodes() only really needs to query for the nid, which will simplify this query and make it much quicker.
Since you don't need ->addTag('node_access) for these (this is an admin thing, so bypassing access control is OK), you can convert these to static db_query() calls.
This should also have an action associated with it for the admin/content page for people who don't have VBO installed.
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 module squeaks by the our recomendatins for full vetted access, but it looks like evrything is done properly, and the application shows understanding of multiple APIs.
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 #21
mpdonadioThanks for your contribution, T-lo !
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 #22
t-loHi mpdonadio,
Thanks for the review and the account update!