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
return blogapi_error($user);
}
$nid = $postid;
$terms = array();
$node = node_load($postid);
$node->taxonomy = array();
foreach ($categories as $category) {
$terms[] = $category['categoryId'];
$node->taxonomy[] = $category['categoryId'];
}
module_invoke('taxonomy', 'node_save', $nid, $terms);
return true;
node_save($node);
return TRUE;
}
/**
......
......@@ -445,13 +445,13 @@ function blogapi_mt_set_post_categories($postid, $username, $password, $categori
return blogapi_error($user);
}
$nid = $postid;
$terms = array();
$node = node_load($postid);
$node->taxonomy = array();
foreach ($categories as $category) {
$terms[] = $category['categoryId'];
$node->taxonomy[] = $category['categoryId'];
}
module_invoke('taxonomy', 'node_save', $nid, $terms);
return true;
node_save($node);
return TRUE;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment