Patch for blogapi.module in Drupal 4.7.0 beta 4
In Drupal 4.7.0 beta 4, blogapi.module mostly works fine with Post2Blog unless 2 points. The first one occurs when trying to edit post. Categories will not return via XML-RPC. Below is my patch.
diff -u blogapi.module.orig blogapi.module
--- blogapi.module.orig 2006-01-12 17:02:45.000000000 +0700
+++ blogapi.module 2006-01-27 16:02:51.000000000 +0700
@@ -710,6 +710,17 @@
$xmlrpcval["mt_convert_breaks"] = $node->format;
}
+ $terms = module_invoke("taxonomy", "node_get_terms", $node->nid, "tid");
+ $categories = array();
+ foreach ($terms as $term) {
+ $term_name = $term->name;
+ foreach (module_invoke("taxonomy", "get_parents", $term->tid, "tid") as $parent) {
+ $term_name = $parent->name . "/" . $term_name;
+ }
+ $categories[] = $term_name;
+ }
+ $xmlrpcval["categories"] = $categories;
+
return $xmlrpcval;
}
The second problem is in taxonomy.module.
Technorati Tags: Bug, English, Review, Drupal, Tips and Tricks, Patch, BlogAPI
- sugree's blog
- 681 reads
Post new comment