Support from Acquia helps fund testing for Drupal Acquia logo

Comments

moshe weitzman’s picture

looks good. maybe swap the doxygen for each param so they match the order in the function signature

greggles’s picture

Title: Provide a "publish comment" action » Provide a "publish comment" action (and cleanup comment action doxygen and whitespace)
FileSize
3.32 KB

I had just copied this from the other actions in the file which had misleading doxygen.

So, here is a new version of the patch which fixes the doxygen and some trailing whitespace. I apologize to the kittens :/

moshe weitzman’s picture

Status: Needs review » Needs work

Nice doxy cleanup.

  1. parens indentation mistake below our declaration of the comment_publish_action action

I will rtbc after that.

rszrama’s picture

Status: Needs work » Needs review
FileSize
3.51 KB

Re-rolled with Moshe's recommendation along w/ commas after the closing ) for the hooks arrays per the Arrays coding standards (comma at the end of the last array element).

Status: Needs review » Needs work

The last submitted patch failed testing.

stella’s picture

Status: Needs work » Needs review
FileSize
2.97 KB

Patch re-roll.

stella’s picture

and a Drupal 6 version

cburschka’s picture

Status: Needs review » Needs work

Yay! I pored over this excellent patch in search of typos and actually found something! :)

+  db_update('comment')
+    ->fields(array('status' => COMMENT_PUBLISHED,))
+    ->condition('cid', $cid)
+    ->execute();

Trailing commas are only supposed to be added to multi-line arrays, so the one after COMMENT_UNPUBLISHED should go.

Got nothing else, though.

stella’s picture

Status: Needs work » Needs review
FileSize
2.96 KB

Patch re-roll, thanks Arancaytar for the review!

Dries’s picture

Status: Needs review » Needs work

Please add a test for this to actions.test. Thanks!

stella’s picture

Status: Needs work » Postponed

Marking as postponed as it's currently not possible to configure multiple actions in test cases because simpletest is unable to handle multiple forms on the same page all with the same submit button value. The admin/build/trigger/comment page is one such page. I created a patch to address this issue in simpletest in #421084: Allow drupalPost() to specify what form_id to submit to if multiple, so marking as postponed until that's committed.

Also, don't you think it might be better to add those tests to comment.test as it is the comment module that defines them? Failing that in trigger.test as that's currently where the node level actions are tested?

leoklein’s picture

Thank you so much for the D6 version! Just what I needed.

EvanDonovan’s picture

Thanks so much for the D6 version. This seems to me to be more of a bug report than a feature request, since it seems like a strange omission from the list of actions.

Is this still postponed for D7, and can it still be considered even though Sept. 7 has passed? It would be a shame to have to keep patching this in or else add it in a custom module.

sun’s picture

Title: Provide a "publish comment" action (and cleanup comment action doxygen and whitespace) » Provide a "publish comment" action (and cleanup some actions doxygen)
Assigned: greggles » Unassigned
Category: feature » task
Status: Postponed » Needs review
Issue tags: +API clean-up
FileSize
6.22 KB

We badly need this.

Tagging.

Regarding tests, please see #582316: Add tests for actions. It makes no sense to hold off this patch, because we have no tests and especially no pattern for tests for actions yet.

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

code and docs look great to me

sun’s picture

'description' is 'label' now.

Did I mark #582316: Add tests for actions as critical bug report? Yes, I did. ;)

sun’s picture

Also, please make sure before committing this:

Passed: 185 passes, 0 fails, 0 exceptions

I see no reason for why this patch could kill 12,000+ tests, so I hope the new patch will do better.

sun’s picture

Title: Provide a "publish comment" action (and cleanup some actions doxygen) » "Publish comment" action is missing (and cleanup some actions doxygen)
Issue tags: +actions

Better title. Last patch also passed tests properly now.

sun’s picture

Issue tags: +D7 API clean-up

Tagging absolutely critical clean-ups for D7. Do not touch this tag. Please either help with this or one of the other patches having this tag.

Status: Reviewed & tested by the community » Needs work

The last submitted patch failed testing.

sun’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
6.02 KB

Re-rolled against latest HEAD.

webchick’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs documentation

Yeah. I agree with kicking tests to another issue, given the point in the release cycle we're at now. It's completely silly that this action isn't there, given that unpublish is. Hope to see some of you in the actions.inc test issue!

Committed to HEAD. Please document this in the D6 => D7 module upgrade guide, so contrib modules that are currently offering their own know they can remove them.

sun’s picture

Issue tags: -D7 API clean-up

.

EvanDonovan’s picture

Thanks, sun for advocating for this & webchick for committing it! Would it be too much to ask for this to be backported to D6? If it is, I can just continue patching it in each time a minor version upgrade comes out.

joetsuihk’s picture

sub

is #21 patch ready to back port to D6?

andypost’s picture

Tests already in and a bit tuned at #699596: (Un)publishing several comments doesn't work

andypost’s picture

Version: 7.x-dev » 6.x-dev
Category: task » bug
Status: Needs work » Needs review
Issue tags: -API clean-up +Needs backport to D6
FileSize
5.64 KB

Here's a backport of #21 for D6

I think it's a bug and also great fix for docs!

joetsuihk’s picture

re#27

publish comment appears on "action" "view bulk operation", "rules"

and tested in "view bulk operation", so i think it behaves correctly. Thanks for the patch!

maybe left next tester to mark this "reviewed and tested"?

Encarte’s picture

subscribe

nileshgr’s picture

#27,

Your patch is good, but I was unable to apply it with just one command.

I had to split into two patch files and then apply each individually. :(

andypost’s picture

@nilesh.3892 do you patch against current CVS? I've tested this and patch still cleanly applies

Could someone confirm and RTBC this

nileshgr’s picture

I patched it against D6.16

andypost’s picture

tested against 6.16 and it's fine

nileshgr’s picture

What patch command did you issue ?

andypost’s picture

As always http://drupal.org/patch/apply

wget http://drupal.org/files/issues/360023-action-comment-publish-d6.patch
patch -p0 < 360023-action-comment-publish-d6.patch
nileshgr’s picture

Hmm, I think I missed that -p0

andypost’s picture

So could you RTBC this? or we need more reviews?

nileshgr’s picture

Its working with -p0.

nileshgr’s picture

Status: Needs review » Reviewed & tested by the community
Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Oh, great, thanks, committed.

sun’s picture

Does anyone have VBO installed and is already using VBO's comment publish action? To my knowledge, VBO is the only contrib module that provides the missing action.

I didn't test updating to 6.x-dev + VBO myself yet, and can only hope that we didn't break anything with this commit.

I hope that someone else is able to test and report back -- hopefully before 6.17 is released.

nileshgr’s picture

I am using VBO, but it didn't provide the action by default. I had to apply the patch.

joetsuihk’s picture

re@42 agreed. VBO is the org. point where i find this thread and fixed by apply patch.

Status: Fixed » Closed (fixed)

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

aleksey.tk’s picture

Status: Closed (fixed) » Active

I'm wondering why you're not updating node_comment_statistics on comment publish/unpublish actions? Current behavior breaks many things if you use this actions in Rules like unpublish comment after 30 days (just an example) - node comment statistics is not updated and you have outdated info in your blocks, node objects, etc.

Update: checked latest alpha of Drupal 7, functionality is the same. Am i the only one who see this problem?

greggles’s picture

Title: "Publish comment" action is missing (and cleanup some actions doxygen) » Update node_comment_statistics during "Publish comment" action
Version: 6.x-dev » 7.x-dev
Issue tags: -Needs documentation

Better title and version. We should fix in 7.x first and then port back.

moshe weitzman’s picture

oops - wrong issue. deleted

Steven Jones’s picture

@cyberpunk No, you're not the only one. Should be a fairly simple patch. Will need tests too.

Steven Jones’s picture

Status: Active » Needs work
Issue tags: +Needs tests
FileSize
1.24 KB

Here's a patch that adds the needed calls to the actions, needs tests, and testing.

andypost’s picture

Code-comment should end with comma

Steven Jones’s picture

Actually should be a full-stop instead of the colon.

EvanDonovan’s picture

Issue tags: -Needs backport to D6, -Needs tests, -actions +the founder of <a href=

Didn't realize this still needed reviews. Thanks comment spam for reminding.

EvanDonovan’s picture

Issue tags: -the founder of <a href= +Needs backport to D6, +Needs tests, +actions

Fixed tags.

Tor Arne Thune’s picture

Version: 7.x-dev » 8.x-dev
Tor Arne Thune’s picture

Version: 8.x-dev » 7.x-dev
Issue tags: +Needs backport to D7
Tor Arne Thune’s picture

Version: 7.x-dev » 8.x-dev

*sigh*

kongoji’s picture

Hi, this is a sort of backport of #50 patch for Drupal 6

andypost’s picture

Issue tags: +Needs reroll

Is this still valid?

alansaviolobo’s picture

Version: 8.x-dev » 7.x-dev
Issue summary: View changes
Issue tags: -Needs reroll

I believe the tags need to be updated.

  • webchick committed 970b096 on 8.3.x
    #360023 by stella, sun, greggles: Added 'Publish comment' action +...

  • webchick committed 970b096 on 8.3.x
    #360023 by stella, sun, greggles: Added 'Publish comment' action +...

  • webchick committed 970b096 on 8.4.x
    #360023 by stella, sun, greggles: Added 'Publish comment' action +...

  • webchick committed 970b096 on 8.4.x
    #360023 by stella, sun, greggles: Added 'Publish comment' action +...

  • webchick committed 970b096 on 9.1.x
    #360023 by stella, sun, greggles: Added 'Publish comment' action +...