taxonomy_service patch for d7
| Project: | Services |
| Version: | 7.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | ilo |
| Status: | active |
Jump to:
Hi
I just assigned for myself as I had already started to look at it. As commented in #626730: xmlrpc_server patch for d7, I'll be detailing the issues I've found on this module for now, until we have conditions to create a patch (awaiting for heyrocker's services core patch).
current issue list for taxonomy_server module:
- taxonomy_service.info file missing core = 7.x and files[] directives.
- taxonomy_get_tree() function signature has changed, being used in taxonomy_service_get_tree().
- taxonomy_select_nodes() function signature has changed, being used in taxonomy_service_select_nodes().
- node_load() function signature has changed, being used in taxonomy_service_select_nodes() (just to notice, seems it is used the right way now).
- services_node_load() (from services.module) function signature is incomplete, used in taxonomy_service_select_nodes();
-.taxonomy_save_term() function NO LONGER EXISTS in Drupal 7, needs replacement, used in taxonomy_service_save_term().
-.taxonomy_save_vocabulary() function NO LONGER EXISTS in Drupal 7, needs replacement, used in taxonomy_service_save_vocabulary().
- hashes are being used for service definition (see #616490: Services API misuses hash/number (#) symbols)

#1
I've found the replacement for the functions taxonomy_save_term and taxonomy_save_vocabulary(). Now, while I'm rewriting the taxonomy_select_nodes() I'm in doubt if I'm doing right. Let me explain.
taxonomy_service module is a services interface for the taxonomy module. In fact, function signatures says "Services interface to taxonomy_save_term().", but it happens that this function does not exist in D7, therefore it makes no sense to keep this description, and instead of this message, the new "Services interface to taxonomy_term_save()." message has been included.
Up to here, as long as functions do the same, but only the name has changed I'm quite confident that it is ok. But then I reached taxonomy_select_nodes(). The function has change drastically, and the results are not the same as they were before. Some arguments have also changed, and where in D6 the function does: "Finds all nodes that match selected taxonomy conditions.", in D7 the function now does: "Return nodes attached to a term across all field instances.".
In D6, taxonomy_select_nodes() allows to specify the depth of the query, in d7 there is no $depth argument but a new $limit argument can reduce the number of returned nodes. So, here is my concern.. As long as the service signature says: "Services interface to taxonomy_select_nodes()." should I change the taxonomy service definition and set the appropriate arguments for the new d7 function signature? or should I remove this line and include the d6 functionality for this service in the d7 version?
#2
I would change the service definition and set appropriate arguments for D7 function signature. The services functions have always tried to match the same function in core, and we should continue that.
#3
Doing this we should agree/document that upgrade path is broken for taxonomy_service, and this may settle the basics for other services submodules update to d7.. if we are going to break upgrade path, we can do fix issues like that where the xmlrp_server is ignoring error codes.