Skip to content
Snippets Groups Projects
Commit 16051d46 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch 42210 by Neil: Save whole node instead of saving taxonomy.

parent 4e350604
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -445,13 +445,13 @@ function blogapi_mt_set_post_categories($postid, $username, $password, $categori ...@@ -445,13 +445,13 @@ function blogapi_mt_set_post_categories($postid, $username, $password, $categori
return blogapi_error($user); return blogapi_error($user);
} }
$nid = $postid; $node = node_load($postid);
$terms = array(); $node->taxonomy = array();
foreach ($categories as $category) { foreach ($categories as $category) {
$terms[] = $category['categoryId']; $node->taxonomy[] = $category['categoryId'];
} }
module_invoke('taxonomy', 'node_save', $nid, $terms); node_save($node);
return true; return TRUE;
} }
/** /**
......
...@@ -445,13 +445,13 @@ function blogapi_mt_set_post_categories($postid, $username, $password, $categori ...@@ -445,13 +445,13 @@ function blogapi_mt_set_post_categories($postid, $username, $password, $categori
return blogapi_error($user); return blogapi_error($user);
} }
$nid = $postid; $node = node_load($postid);
$terms = array(); $node->taxonomy = array();
foreach ($categories as $category) { foreach ($categories as $category) {
$terms[] = $category['categoryId']; $node->taxonomy[] = $category['categoryId'];
} }
module_invoke('taxonomy', 'node_save', $nid, $terms); node_save($node);
return true; return TRUE;
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment