This works just fine:
http://mysite.com/api/node?fields=nid,uid¶meters[uid]=1
But this ALWAYS return an empty set
http://mysite.com/api/comment?fields=nid,uid¶meters[uid]=1
This:
$query = services_resource_build_index_query('comments', 'c.timestamp DESC', $page, $fields, $parameters, 'c', 'cid', $page_title, 'comment');
Returns zero results, no matter the arguments. I tested it with var_dump.
The result is always:
<?xml version="1.0" encoding="utf-8"?>
<result/>
Am I doing something wrong, or there is a major bug in the module?
Thanks!
Comments
Comment #1
kylebrowning commentedIm not sure what mistakes you're making, does the user have permissions to access comments? Im getting results...
Comment #2
kylebrowning commentedComment #3
tschellhorn commentedI came across this issue with using a regular user that did not have 'administer comments' access.
I think the problem comes up with how the code in the services/resources/comment_resource.inc file at line 210 to 212:
When I looked up how the comments were listed, the "status" is opposite of a node status. For comments, "0" means "published" and "1" means unpublished.
To make it work for users that didn't have the 'administer comments' access, I changed it to the following:
I hope that helps track down the problem here.
I am using the services module version 6.x-3.3.
Trevor
Comment #4
tschellhorn commentedHere is the patch for that to make it easier.
Trevor
Comment #5
Fidelix commentedComment #6
marcingy commentedThis needs to be fixed in 7.x first
Comment #7
jerenus commentedMistake.
Comment #8
jerenus commentedMistake.
Comment #9
jerenus commentedMistake.
Comment #10
jerenus commentedPatch for V6.
Comment #11
marcingy commentedPlease do not change version this needs to be fixed in d7 first.
Comment #12
jerenus commented7.x-3.x still need this?
http://drupalcode.org/project/services.git/blob/refs/heads/7.x-3.x:/resources/comment_resource.inc#l326
Comment #13
marcingy commentedAh ok my bad - rbtc it is then. Thank you :)
Comment #14
kylebrowning commentedComment #15
kylebrowning commentedComment #16
ygerasimov commentedCommitted.
Comment #17
jerenus commented:)
Comment #18.0
(not verified) commentedremoving private info