Closed (fixed)
Project:
Services
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
11 Feb 2011 at 19:05 UTC
Updated:
19 Nov 2011 at 01:15 UTC
Jump to comment: Most recent file
This is issue for the comment equivalent of #1051158: Convert files/nodeFiles action to node/x/files relationship
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 0001-Issue-1058934-heyrocker-voxpelli-kylebrowning-Conver.patch | 13.97 KB | kylebrowning |
| #6 | 0001-voxpelli-updates-for-1058934.patch | 6.34 KB | kylebrowning |
| #4 | 0001-Re-roll-of-1058934.patch | 5.99 KB | kylebrowning |
| #1 | 1058934.patch | 6.38 KB | gdd |
Comments
Comment #1
gddAttached patch does the following:
Removes loadNodeComments action from comment resource.
Adds comments relationship to node resource.
Simplifies permissions handling. Instead of a custom callback, we just check for 'access comments' and run the query through node access rules.
It occurs to me that we could also add timestamp as a parameter and be able to get rid of the countNew action in comment resource, but one thing at a time.
Comment #2
kylebrowning commentedThis was fixed in the latest comments update
Comment #3
gddThis was not in that patch, as this one adds to node resource and that wasn't touched in the last comments update.
Comment #4
kylebrowning commentedheres a re-roll for the 7.x-3.x branch to be applied via git apply patchname
Comment #5
voxpelli commentedHere's lots of random and probably not very relevant comments but I don't have time to actually test the code now so all I could do was read through the patch and nitpick it ;)
---
We need a module_exists() somewhere as comments are optional - right?
Weird indention?
Choose to either align all "=>" or none - what do we do in the rest of Services?
Should these properties really be part of the path or am I misunderstanding something? Count and offset should be query properties - not part of the path in my opinion
Are we using "start" elsewhere? Isn't "offset" a more common term?
Trailing white space here
We could use comment_load_multiple() here instead - right?
Powered by Dreditor.
Comment #6
kylebrowning commentedHeres an updated patch regarding voxpelli's comments
Comment #7
voxpelli commentedNo comment_load_multiple() in that patch? Not possible to use it?
Comment #8
kylebrowning commentedOK fixed, i also added the tests for the new location.
Comment #9
ygerasimov commentedI don't think it is nice to do
We should use hook_services_resources_alter in order to alter node resource and add comment relationship.
Callback function can stay in comment_resource.inc file but alter of resource should be done through hook.
Gents, what do you think about this?
Comment #10
kylebrowning commentedI dunno, does that work?
Comment #11
voxpelli commented@ygerasimov: Since we include all resource declarations anyway I think it's a bit overkill to use hook_services_resources_alter(). If the resources was declared by two separate modules I would agree with you, but for core I think it's best if all properties of the a resource is declared in that resource's include file.
A good use case of hook_services_resources_alter() in core is the REST Server's extension of node resources with feed models in rest_server_services_resources_alter(). As the REST Server is a separate module from Services core those extensions shouldn't be made in Services core but in the module itself.
Comment #12
kylebrowning commentedComment #13
kylebrowning commented