I'm really not a big expert in php, Drupal, or services module. However, the following code in comment_service.inc seems to be incorrect:

function comment_service_save($comment) {
// If the submitted comment does not contain a uid, set it to anonymous.
if (isset($comment->uid)) {
$uid = 0;
}

First, I believe '!' is missing in the condition as we're trying to check if $comment->uid is NOT defined.
Second, I would expect "$comment->uid = 0" within the if body as $uid is not used anywhere in this function.

I cannot test this as I ran into an access denied error on comment services calls (opened a separate support request). But just wanted to log this in case I'm right ...

Micah

CommentFileSizeAuthor
#2 comment-save.patch798 bytesmarcingy
#1 comment-save.patch816 bytesmarcingy

Comments

marcingy’s picture

Status: Active » Needs review
StatusFileSize
new816 bytes

This patch takes the above report and creates a patch for it.

marcingy’s picture

StatusFileSize
new798 bytes

windows line ending fixed

gdd’s picture

Status: Needs review » Fixed

Committed, thanks

Status: Fixed » Closed (fixed)

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