Closed (fixed)
Project:
Services
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
10 Feb 2011 at 06:48 UTC
Updated:
3 Mar 2011 at 00:38 UTC
Jump to comment: Most recent file
In taxonomy resource delete method's arguments don't have types.
Comments
Comment #1
ygerasimov commentedHere is patch with trailing spaces removal.
Comment #2
ygerasimov commentedI have found a lot issues in taxonomy resource so I propose to join them all together here and have one patch that fix them all.
At the moment following fixes applied:
1. argument types in delete methods
2. _taxonomy_term_resource_retrieve: use taxonomy_term_load instead of D6 taxonomy_term_load
3. _taxonomy_term_resource_update: load vid of term in case it is not passed with argument
4. _taxonomy_vocabulary_resource_create: use taxonomy_vocabulary_save() instead of D6 taxonomy_save_vocabulary
5. _taxonomy_vocabulary_resource_delete: use taxonomy_vocabulary_delete instead of D6 taxonomy_del_vocabulary
Comment #3
gddThis is the only part I have a question about. Is it really necessary? Drupal generally doesn't protect users from errors like this, and I kind of feel like if someone passes in a malformed term then that is their problem.
The rest of the patch looks good though
Powered by Dreditor.
Comment #4
gddTaxonomy resource is a mess. Here is a new patch that combines yuriy's changes with a rewritten permissions concept that is much more sane. As far as the piece I questioned above, I was talking in IRC about how we need a coherent way to deal with updates where the identifier in the body doesn't match the identifier in the path. Patch for that forthcoming.
Comment #5
gddNew patch with less typos
Comment #6
kylebrowning commentedPatch looks good,
My one an only concern are things like this,
+ $vocabulary = (object) $vocabulary;
WE are typecasting through the entirety of Services and I believe its caused issue in the pass about struct vs array.
What are we doing about this? Should we define a standard for handling this, like, Everything we deal with should be an object, and converted to an array if necessary? Or everything should be an array and converted to an object if necessary?
It just seems to keep coming up and maybe this should be in another Task, but I just want to know what your thoughts are.
Edit: RE #3. I think its absolutely imperative that we try and mae the development experience of Services as easy to use as possible. Without it adoption will be extremely slow unless we have like the best documentation ever done on a drupal project. If we can do that great, but it might be easier to catch things like that in the long run.
Comment #7
ygerasimov commentedRegarding #3. I think we should keep helping user to form arguments properly. Why not?
I had tests that were running smoothly on my patch but now they fail in many places. I would like to ask to hold with committing this patch for couple of days. I will publish patch with test here.
Comment #8
ygerasimov commentedHere is patch with tests for taxonomy.
It depends on #1060124: Remove inheritance logic for relationships and actions.
Comment #9
ygerasimov commentedPatch rerolled against current HEAD.
Comment #10
bestenator commentedHello ygerasimov, I'm a newbie with drupal, php and opensource software. I don't know if this is the metod to report bugs, so sorry if not is this.
I found a bug using taxonomy get terms, for example, trying http://myserver/my endpoint-rest/term/2 produce Fatal error: Call to undefined function taxonomy_get_term() in C:\wamp\www\sites\all\modules\services\resources\taxonomy_resource.inc on line 247
When Reading the taxonomy_resource.inc on line 247, there is a call to the function taxonomy_get_term() that not is in the 7.x version.
Thank you very much for your work!
Comment #11
ygerasimov commented@bestenator yes, there are some functions in taxonomy resource that were not ported to D7. Please apply my patch above and check if the problem is still there.
Comment #12
bestenator commentedygerasimov, great and quick! :-D . Aplying the #2 patch, this http://myserver/my-endopoint-rest/vocabulary/2 and this http://myserver/my-endopoint-rest/term/2 ARE OK!.
This http://myserver/my-endopoint-rest/node are OK but http://myserver/my-endopoint-rest/vocabulary and this http://myserver/my-endopoint-rest/term don't return results. It's must to return the collections of vocabulary and terms?. I'm not sure if this is a bug, because the index clausule in taxonomy vocabulary resource and the index clausule in taxonomy term resource not exist.
Thank you again!
Comment #13
kylebrowning commentedTests and patches look great, however the public function dsm($var) { probably needs to be moved elsewhere.
Do that and Ill commit
Comment #14
ygerasimov commented@kylebrowning Thank you for the review. I completely agree on removing dsm().
Comment #15
ygerasimov commentedResubmitting patch (previous didn't had actual test).
Comment #16
ygerasimov commented@bestenator The proper urls to calls are http://www.example.com/endpoint/taxonomy_term/X and http://www.example.com/endpoint/taxonomy_vocabulary/X
There are no index calls for taxonomy_vocabulary or taxonomy_term so it not a bug. Please descibe in what case do you need index calls for these resources. If you need those calls please create separate issue for that.
Thank you for comments.
Comment #17
kylebrowning commentedNice job, this is RTBC for me.
Comment #18
bestenator commentedOk, I created two alias, one to vocabulary and another for terms, this is the reason form my urls...
I needed the index in term and vocabulary to expose to a client aplication the diferent values, for example of a term inside a vocabulary.
I thought that this was a functionality similar than "Get comments: GET /services/rest/node/123/comments"
I Understand that this must be a diferent issue.
Thank you very much!
Comment #19
gddThis needs a reroll after recent commits. I made the changes but I am having trouble with the patch. Will get it up tomorrow, but I think it looks good. One thing I would like to see not just here but elsewhere is tests that assure users without access fail (in addition to that users with access succeed.)
Comment #20
ygerasimov commentedHere is reroll of this patch.
Comment #21
ygerasimov commentedOops. This patch is without CVS header.
Comment #22
gddI finally committed this! Thank you ygerasimov for all the work.
Comment #23
kylebrowning commentedYayy
Comment #24
kylebrowning commentedYayy