Closed (fixed)
Project:
Services
Version:
6.x-3.x-dev
Component:
Code
Priority:
Major
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
18 Feb 2011 at 08:01 UTC
Updated:
11 Apr 2011 at 23:01 UTC
Jump to comment: Most recent file
As far as I can see currently all comments saving is done using comment_save() function. This is nice but we have headache about validation (access as well). What I propose to do is to switch comments to drupal_form_submit like in node resource.
Please advise your comments.
| Comment | File | Size | Author |
|---|---|---|---|
| #23 | 1065568-d6-comment-switch-to-drupal-execute-reroll.patch | 14.47 KB | ygerasimov |
| #20 | 1065568-d6-comment-switch-to-drupal-execute.patch | 14.55 KB | ygerasimov |
| #11 | 1065568-comment-resource-tests-create-method-array.patch | 21.23 KB | ygerasimov |
| #9 | 1065568-comment-resource-tests.patch | 21.13 KB | ygerasimov |
| #8 | 1065568.patch | 21.12 KB | gdd |
Comments
Comment #1
ygerasimov commentedAttached patch for porting comment resource to D7 + tests.
Comment #2
kylebrowning commentedRemove the watchdog, and then make sure to add back in, filter_access.
You can see my patches in #1045724: Creating comments issue for how I accomplished that,
other than that it looks good.
WEll also need to port this to 6x afterwords
Comment #3
ygerasimov commentedThere is no need to add filter access. You can see in tests that I try to add comment with full_html filter that is not allowed. As we run saving using form, validation error gets triggered. So we are secured that user can add comment with only allowed filter.
Comment #4
kylebrowning commentedRight im sorry, yes, this looks good, thanks for removing the watchdog.
Comment #5
gddThis patch is actually backwards, for instance it is removing drupal_form_submit() and adding drupal_execute(). Please reroll.
Comment #6
ygerasimov commentedrerolled patch
Comment #7
rfaySetting to CNW just because the testbot is testing over and over and we need to figure out why. OK to retest later.
Comment #8
gddI recently had a discussion with the security team in which they said that it was not necessary to have access to view a node in order to view its comments. Core does not check for this either. Therefore we should change our access callbacks to reflect this. I have adjusted the patch to reflect this. I don't think this affects test at all, but I'm not positive. New patch has been attached.
Otherwise I think this is good if someone else can verify.
Comment #9
ygerasimov commentedIt is strange that nodes can be viewed even when user cannot view the node. But it is ok. Tests run fine. I have removed trailing spaces.
Comment #10
kylebrowning commentedMy only concern is this,
Why are we typecasting it to an object?
In other parts of Services (node, user) were are returning an array.
Other than that it looks great, but changing that will almost certainly affect tests so if it does chnage well need to adress that.
Comment #11
ygerasimov commentedI think it is reasonable change it to array. Here is patch with all tests passing.
Meanwhile 6.x-3.x had object as answer as well.
Comment #12
rfayThis one doesn't get past "queued for testing" because Services HEAD (master branch) is not passing tests: http://qa.drupal.org/pifr/test/100369
Comment #13
kylebrowning commentedrfay, the tests pass locally. :( I think the testbot doesnt know what our dependencies are.
Comment #14
rfayPIFR does not yet handle contrib dependencies, unfortunately.
Comment #15
kylebrowning commentedYeah, i had a discussion with boomba about it, but he said theres a patch that makes it work
Comment #16
kylebrowning commentedOK This looks good.
Now we just need the 6.x version.
Comment #17
kylebrowning commentedComment #18
gddComment #20
ygerasimov commentedHere is port to D6.
Comment #21
kylebrowning commented#20 is failing :(
Comment #22
kylebrowning commentedComment #23
ygerasimov commentedrerolled patch attached
Comment #24
kylebrowning commentedFixed and committed.