Closed (fixed)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
15 Jul 2014 at 09:45 UTC
Updated:
16 Aug 2014 at 22:20 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
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 #2
coderider commentedYour git command is not in the correct format.
You cannot use a command in the format
username@git.drupal.org:sandbox/username/repo
It must be in the format
http://git.drupal.org/sandbox/username/repo
Comment #3
alvar0hurtad0Thankyou @coderider it's done now.
Comment #4
keopxPlease put pareview.sh link into this issue description: http://pareview.sh/pareview/httpgitdrupalorgsandboxalvar0hurtad02303353git
You've a message: You need to set a default branch 7.x-1.x http://drupal.org/node/1659588
Comment #5
alvar0hurtad0Thank you sensei (@keopx)
Comment #6
keopxPlease chech 3 other project manual reviews.
Check review bonus
Comment #7
keopxComment #8
gwprod commentedIn unpublish_own_comment.module:
On line 17, permissions should generally be entirely lowercase, declarative and related to their title. 'unpublish own comment' would make sense.
The title and description could afford to be more verbose, such as:
(Unpublish Own Comment) and (Allows the user to unpublish comments they have made.)
I'm not sure what the purpose of this is:
Comment #9
keopxSee @gwprod review https://www.drupal.org/node/2303363#comment-8971085
Comment #10
alvar0hurtad0Thankyou @gwprod @keopx
:D
Comment #11
daniel.moberly commentedThe words 'publish' and 'unpublish' should be wrapped as translatable here (lines 22 and 26):
Similarly, you should probably make "available" and "unavailable" translatable as well on line 41:
Finally, this translation call on line 43 does not do anything as you are just passing a variable
Comment #12
alvar0hurtad0Thankyou Daniel it's done
Comment #13
keopxHi @alvar0hurtad0
If user is authenticated and this user has a "Unpublish Own Content" permission, this user don't see link to unpublish
When push unpublish, using user 1, take this error:
Notice: Undefined index: action in unpublish_own_comment_form_submit() (line 40 of /Proyectos/drupal7/sites/all/modules/custom/unpublish_own_comment/unpublish_own_comment.pages.inc).I'm using clear drupal 7.29 installation
Please review it.
Comment #14
keopxHi,
I do a patch for this error:
Review second error ;)
Comment #15
alvar0hurtad0Thanyou so much @keopx. Your patch is applyed and pushed.
Comment #16
alvar0hurtad0Comment #17
alvar0hurtad0Comment #18
alvar0hurtad0Added 3 manual reviews to the project description.
Comment #19
keopxHi Alvar0Hurtad0.
You need add manually tag "PAReview: review bonus" into the main issue ;)
Good work!
Comment #20
miroslavbanov commentedManual review
I did find a patch from two years ago to add this functionality to Comment goodness. Without the patch, Comment goodness has functionality to allow user to delete user's own comment. But it also makes sense to have this module separate from anything else. The module name is very indicative of what it does and will certainly be easy to find.
You have a README.txt, and it's detailed enough, but I saw a few typos and bad wordings:
You'll se the button if -> You'll see the button if
You can admin comments -> You can administer comments
This module is very useful if you need some role must be able to unpublish own
comments but not edit or delete then ->
This module is very useful if you need some role that must be able to unpublish own
comments but not edit or delete them
This looks to be a mistake in
unpublish_own_comment_form_submit()Notice: Undefined index: action in unpublish_own_comment_form_submit() (line 40 of ../unpublish_own_comment.pages.inc).At this point all must be validated, and access checks should have been done, and you can just set status directly:
unpublish_own_comment_access()has 5 returns. I would restructure itTo initialize $access on top:
$access = FALSETo return access at the bottom:
return $access;To have nested if statements in between:
Also, it looks to me like you don't sufficiently check for comment existing and being published. I think comment must absolutely exist and be published in order for the access check to return TRUE, regardless of permissions.
Additional suggestion
With this module, you allow the user to unpublish the comment, even if comments are threaded and there is already an answer to that comment. This would make the thread incoherent, and you should maybe consider this. Comment goodness allows to delete his own comment, but only if there are no answers to that comment already.
Comment #21
miroslavbanov commentedComment #22
alvar0hurtad0Thanyou so much @MiroslavBanov for your review and your comments.
I've change the README.txt (I'm very sorry about my awfull english Im studing hard to improve it).
I've refactor the unpublish_own_comment_access now it's much more clear.
Comment #23
alvar0hurtad0Ok,
It's time for braves.
:D
Comment #24
ratanphp commented@alvar0hurtad0
Your module looks good to me as well. As I reviewed your code and also installed on my local machine.
Additional suggestion
Please add
hook_helpfunction to your .module file.Comment #25
alvar0hurtad0Thankyou @ratanphp for your review and your suggestion.
I've taken your advice and the module now implements the hook_help.
Comment #26
keopxWorks fine!
Comment #27
alvar0hurtad0Checking some projects ....
Comment #28
mpdonadioAssigning to myself for next review.
Comment #29
alvar0hurtad0Ehhhhh
<3 U guy
Thank you so much
Comment #30
mpdonadioAutomated Review
Review of the 7.x-1.x branch (commit 298135f):
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
No. If "no", list security issues identified.
You have a node access bypass problem. If a user has commented on a node, and then for some reason loses read access to the node afterwards, they can
still directly browse to the url defined by your hook_menu and unpublish the comment. You also need to add a
node_access('view', $node) to unpublish_own_comment_access() to make sure that the user has read access to the node on which
they wish to unpublish the comment. Note that the autoloader that gives you the $node doesn't do the check; it is the router
item's responsibility to do this. I also think that you need to check whether comments on the node are hidden or not; users
shouldn't be able to unpublish comments on a node where they are hidden.
The actual permission name in unpublish_own_comment_permission() is a little misleading. It should be more tied to the action, and not what you can see. I would just use 'unpublish own comment'.
In unpublish_own_comment_comment_view(), use theCOMMENT_PUBLISHED instead of the values. See https://api.drupal.org/api/drupal/modules!comment!comment.module/7
In unpublish_own_comment_comment_view(), do you need an additional class to identify this link? Check the other links to see what they have.
(+) unpublish_own_comment_access() needs to check whether the comment is valid or not. The normal checks are isset($node->nid) and isset($comment->cid).
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.
Comment #31
alvar0hurtad0Thank you si mich for tour revision.
I go to the work.
:)
Comment #32
alvar0hurtad0Ok these are the changed I made:
this is the new unpublish_own_comment_access():
I'm not sure about this point, not sure if it's about the current display in a near future I would like to add the compatibility with views and the view type "fields" so it can be a problem.
I Agree, :D
:D
if (($comment->status == COMMENT_PUBLISHED) && unpublish_own_comment_access($node, $comment)) {I think other links are not much different than this one:
it's on the first code block of the comment.
Than you so much again for your time.
Comment #33
miroslavbanov commented@alvar0hurtad0
The
unpublish_own_comment_access()access callback should check$comment->status === COMMENT_PUBLISHED. It is the only problem from my comment #20 that you didn't address. Everything else looks good. I will go ahead and set this one as RTBC.Comment #34
alvar0hurtad0thank you @MiroslavBanov for your review, I've also added your suggestion on the access callback.
:D
Comment #35
klausiReview of the 7.x-1.x branch (commit 5e24b42):
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, so ...
Thanks for your contribution, alvar0hurtad0!
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 #36
alvar0hurtad0Thank YOU all for tour reviews and for spend tour time supporting the community.
I've learn a bunch with the review process and i'll try help reviewing other projects.
Thank you again.
:D