Download & Extend

Fix documentation of comment_reply() return value

Project:Drupal core
Version:7.x-dev
Component:documentation
Category:bug report
Priority:normal
Assigned:TravisCarden
Status:closed (fixed)
Issue tags:documentation, Novice

Issue Summary

The DocBlock comments on comment_reply() document the return value thus:

<?php
/**
* @return
*   The rendered parent node or comment plus the new comment form.
*/
?>

That's not correct. What's actually returned is an array containing a renderable array for the node or parent comment and the comment form as an array. I propose the comment be changed to read something like this:

<?php
/**
* @return array
*   An associative array containing:
*   - An array for rendering the node or parent comment.
*     - comment_node: If the comment is a reply to the node.
*     - comment_parent: If the comment is a reply to another comment.
*   - comment_form: The comment form as a renderable array.
*/
?>

When there's consensus on the change I'll roll a patch.

Comments

#1

Tagging.

#2

Issue tags:+documentation

I like this, but I'm not sure about the established conventions for describing the presence of things like comment_node/comment_parent. In fact, I wonder why the key here needs to change at all.

Please go ahead and make patches in situations like this, that way the status could have been "Needs review" already and can attract the appropriate attention. Tags help too.

#3

Status:active» needs review

Can do! Thanks.

AttachmentSizeStatusTest resultOperations
drupal-1532682-3.patch1.21 KBIdlePASSED: [[SimpleTest]]: [MySQL] 35,060 pass(es).View details

#4

Re-rolled.

AttachmentSizeStatusTest resultOperations
comment-comment_reply-1532682-4.patch1.25 KBIdlePASSED: [[SimpleTest]]: [MySQL] 35,395 pass(es).View details

#5

Status:needs review» reviewed & tested by the community

The patch updates the code as per the summary.

#6

Version:8.x-dev» 7.x-dev
Status:reviewed & tested by the community» patch (to be ported)

Committed to 8.x. Moving to 7.x. for back porting.

#7

Assigned to:Anonymous» TravisCarden
Status:patch (to be ported)» reviewed & tested by the community

Great! Here's the same thing for d7. (Can I put it right into RTBC?)

AttachmentSizeStatusTest resultOperations
comment-comment_reply-1532682-7.patch800 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 39,092 pass(es).View details

#8

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

I don't see this in D8 yet.. anyone else?

Let's also move it to the documentation queue - @jhodgdon will likely snag reviewing/committing it there before any of the rest of us gets around to it :)

#9

Component:comment.module» documentation

Um, I forgot to actually move it, apparently.

#10

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

Committed it to 8.x. For real now. Moving back to 7.x.

#11

I still don't see the commit. It should be in the repository pretty much immediately, right?

#12

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

You're right, maybe it was committed but never pushed? I'm actually seeing the same thing for a few other issues too, so I will bump them back to Drupal 8 also.

#4 is still RTBC for Drupal 8. Hopefully third time's the charm :)

#13

Status:reviewed & tested by the community» fixed

Forgot to push my changes. It is committed now: http://drupalcode.org/project/drupal.git/commit/1ed9d79.

#14

Version:8.x-dev» 7.x-dev
Status:fixed» reviewed & tested by the community

I see you learned my trick - if you paste the commit link into the issue, that guarantees you'll never forget to push :)

#7 looks RTBC for Drupal 7 to me.

#15

Status:reviewed & tested by the community» fixed

The patch in #7 has been committed (and pushed :) ) to Drupal 7.x. Thanks!

#16

Status:fixed» closed (fixed)

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

nobody click here