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

/**
 * @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:

/**
 * @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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

TravisCarden’s picture

Issue tags: +Novice

Tagging.

lotyrin’s picture

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.

TravisCarden’s picture

Status: Active » Needs review
FileSize
1.21 KB

Can do! Thanks.

TravisCarden’s picture

Re-rolled.

dastagg’s picture

Status: Needs review » Reviewed & tested by the community

The patch updates the code as per the summary.

Dries’s picture

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.

TravisCarden’s picture

Assigned: Unassigned » TravisCarden
Status: Patch (to be ported) » Reviewed & tested by the community
FileSize
800 bytes

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

David_Rothstein’s picture

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 :)

David_Rothstein’s picture

Component: comment.module » documentation

Um, I forgot to actually move it, apparently.

Dries’s picture

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

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

TravisCarden’s picture

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

David_Rothstein’s picture

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 :)

Dries’s picture

Status: Reviewed & tested by the community » Fixed

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

David_Rothstein’s picture

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.

jhodgdon’s picture

Status: Reviewed & tested by the community » Fixed

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

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