Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
0de72ee4
Commit
0de72ee4
authored
Jun 05, 2009
by
Dries
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Patch
#225864
by pwolanin: prevent PHP errors from cron.php.
parent
3780e8a6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
modules/taxonomy/taxonomy.module
modules/taxonomy/taxonomy.module
+4
-2
modules/taxonomy/taxonomy.test
modules/taxonomy/taxonomy.test
+14
-0
No files found.
modules/taxonomy/taxonomy.module
View file @
0de72ee4
...
...
@@ -1639,8 +1639,10 @@ function taxonomy_node_validate($node, $form) {
*/
function
taxonomy_node_update_index
(
$node
)
{
$output
=
array
();
foreach
(
$node
->
taxonomy
as
$term
)
{
$output
[]
=
$term
->
name
;
if
(
isset
(
$node
->
taxonomy
)
&&
is_array
(
$node
->
taxonomy
))
{
foreach
(
$node
->
taxonomy
as
$term
)
{
$output
[]
=
$term
->
name
;
}
}
if
(
count
(
$output
))
{
return
'<strong>('
.
implode
(
', '
,
$output
)
.
')</strong>'
;
...
...
modules/taxonomy/taxonomy.test
View file @
0de72ee4
...
...
@@ -354,6 +354,20 @@ class TaxonomyTermUnitTest extends TaxonomyWebTestCase {
// 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'."
));
// 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'
));
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment