Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
5de2f764
Commit
5de2f764
authored
Apr 17, 2012
by
catch
Browse files
Issue
#277200
by andypost, Damien Tournoud: Add tests for vocabulary hierarchy.
parent
ce793fee
Changes
2
Hide whitespace changes
Inline
Side-by-side
core/modules/taxonomy/taxonomy.module
View file @
5de2f764
...
...
@@ -517,7 +517,7 @@ function taxonomy_check_vocabulary_hierarchy(TaxonomyVocabulary $vocabulary, $ch
$hierarchy
=
TAXONOMY_HIERARCHY_MULTIPLE
;
break
;
}
elseif
(
count
(
$term
->
parents
)
==
1
&&
0
!==
array_shif
t
(
$term
->
parents
))
{
elseif
(
count
(
$term
->
parents
)
==
1
&&
!
isse
t
(
$term
->
parents
[
0
]
))
{
$hierarchy
=
TAXONOMY_HIERARCHY_SINGLE
;
}
}
...
...
core/modules/taxonomy/taxonomy.test
View file @
5de2f764
...
...
@@ -584,6 +584,10 @@ class TaxonomyTermTestCase extends TaxonomyWebTestCase {
$term1
=
$this
->
createTerm
(
$this
->
vocabulary
);
$term2
=
$this
->
createTerm
(
$this
->
vocabulary
);
// Check that hierarchy is flat.
$vocabulary
=
taxonomy_vocabulary_load
(
$this
->
vocabulary
->
vid
);
$this
->
assertEqual
(
0
,
$vocabulary
->
hierarchy
,
'Vocabulary is flat.'
);
// Edit $term2, setting $term1 as parent.
$edit
=
array
();
$edit
[
'parent[]'
]
=
array
(
$term1
->
tid
);
...
...
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