- Patch #225864: rollback based on discussion.
parent
29e3ab6091
commit
212d378177
|
@ -1707,10 +1707,8 @@ function taxonomy_node_validate($node, $form) {
|
||||||
*/
|
*/
|
||||||
function taxonomy_node_update_index($node) {
|
function taxonomy_node_update_index($node) {
|
||||||
$output = array();
|
$output = array();
|
||||||
if (isset($node->taxonomy) && is_array($node->taxonomy)) {
|
foreach ($node->taxonomy as $term) {
|
||||||
foreach ($node->taxonomy as $term) {
|
$output[] = $term->name;
|
||||||
$output[] = $term->name;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (count($output)) {
|
if (count($output)) {
|
||||||
return '<strong>(' . implode(', ', $output) . ')</strong>';
|
return '<strong>(' . implode(', ', $output) . ')</strong>';
|
||||||
|
|
|
@ -371,20 +371,6 @@ class TaxonomyTermUnitTest extends TaxonomyWebTestCase {
|
||||||
|
|
||||||
// Confirm that the node type argument returns a single node association.
|
// Confirm that the node type argument returns a single node association.
|
||||||
$this->assertEqual(taxonomy_term_count_nodes($term3->tid, 'page'), 1, t("Term is associated with one node of type 'page'."));
|
$this->assertEqual(taxonomy_term_count_nodes($term3->tid, 'page'), 1, t("Term is associated with one node of type 'page'."));
|
||||||
|
|
||||||
// Test hook_nodeapi_update_index().
|
|
||||||
// Load the node so taxonomy terms are fully populated.
|
|
||||||
$node = node_load($node1->nid);
|
|
||||||
$output = taxonomy_node_update_index($node);
|
|
||||||
$this->assertFalse(empty($output), t('Node with taxonomy has content when calling update index'));
|
|
||||||
// Remove all taxonomy.
|
|
||||||
unset($node->taxonomy);
|
|
||||||
$output = taxonomy_node_update_index($node);
|
|
||||||
$this->assertTrue(empty($output), t('Node with no taxonomy has no content when calling update index'));
|
|
||||||
// Set taxonomy to a scalar (non-array).
|
|
||||||
$node->taxonomy = 1;
|
|
||||||
$output = taxonomy_node_update_index($node);
|
|
||||||
$this->assertTrue(empty($output), t('Node with non-array taxonomy has no content when calling update index'));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue