This one is a little bit harder..
Category validation (on submission) and Category Get and Set services methods don't work anymore. Taxonomy has moved to the Field API, and now each taxonomy field is created as $node->$vocabulary->machine_name, and $node->taxonomy no longer works.
The module should match the submitted categories into the correct node fields now. Several changes have to be done for this to work:
- The vocabulary fields should have to be instantiated for the content type to be used. This is done now in the addVocabulary function of the .test file. Also, the patch is intented to use $blog_id variable returned by the blogger.getUsersBlogs call. addVocabulary does instantiate the vocabulary field in the content type.
- taxonomy_vocabulary_load_multiple can't be used to get the taxonomy fields available for a content type, a replacement using field API has been included in the patch.
- $node->taxonomy usages in the blogapi module should be replaced with the correct field information.
The problem is how to handle more than one category (taxonomy fields) instantiated in the content type. should we use all? only one? Wich one should be used?
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 612544_blogapi_category_usage_and_validation_fails_1.patch | 21.04 KB | ilo |
| #1 | 612544_blogapi_category_usage_and_validation_fails.patch | 3.43 KB | ilo |
| blogapi_category_usage_and_validation_fails.patch | 3.3 KB | ilo |
Comments
Comment #1
ilo commentedmissed two doc lines..
Comment #2
ilo commentedI did change my mind after looking into field API and taxonomy code. Creating the field and managing it programatically broke the flexibility of the field api because of taxomony putting the field instances' cardinality to 'unlimited' so the multiple-choice widgets may work. Due to this, I should go to UI and submit field settings forms, so I moved all the field management to UI requests.
Also I found replacements for the obsolete functionalities regarding the link between categories and node using Field API (thanks to catch tips). I've reviewed the category related functions and refactored the taxonomy validation process. The $node->taxonomy is no longer usable, and in fact, the $node->$field_name only should exist if it is required. I tried to use taxonomy_field_validate but this one relies heavily in Form API validation, so I had to create a custom validation function ignoring field widgets behaviour.
Due to changes I also included more test cases for changed functions.
I'm getting: 64 passes, 0 fails, 0 exceptions, and 13 debug messages on one system, and 61 passes, 2 fails, 3 exceptions, and 13 debug messages on other. Fails and exceptions are generated for the upload functionality.
This patch includes the changes at #612218: BlogAPI TestCase fails: SET/EDIT/DELETE post working, so probably, if that one gets commited this one should be rerolled.
Comment #3
cweagansPatch no longer applies.
Comment #4
ilo commentedJust because #612218: BlogAPI TestCase fails: SET/EDIT/DELETE post working was commited (what is good). The taxonomy/field stuff needs to be reviewed again according to latest Drupal HEAD changes, so the patch is useless anyway.
Comment #5
damienmckennaThis is a sub-task of #719856: Tests do not pass and is dependent upon #728198: Update to work with Drupal 7 beta 3.
Comment #6
cweagansThe 1.x branch is more or less dead, and this will be fixed in 2.x, so closing.