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
939a1f01
Commit
939a1f01
authored
Nov 13, 2008
by
webchick
Browse files
#332145
by catch and Arancaytar: Fix regression on term submit form.
parent
d8aafce2
Changes
3
Hide whitespace changes
Inline
Side-by-side
modules/taxonomy/taxonomy.admin.inc
View file @
939a1f01
...
...
@@ -766,7 +766,7 @@ function taxonomy_form_term_submit($form, &$form_state) {
$current_parent_count
=
count
(
$form_state
[
'values'
][
'parent'
]);
$previous_parent_count
=
count
(
$form
[
'#term'
][
'parent'
]);
// Root doesn't count if it's the only parent.
if
(
$current_parent_count
==
1
&&
isset
(
$form_state
[
'values'
][
'parent'
][
''
]))
{
if
(
$current_parent_count
==
1
&&
isset
(
$form_state
[
'values'
][
'parent'
][
0
]))
{
$current_parent_count
=
0
;
$form_state
[
'values'
][
'parent'
]
=
array
();
}
...
...
modules/taxonomy/taxonomy.module
View file @
939a1f01
...
...
@@ -1089,7 +1089,7 @@ function _taxonomy_term_select($title, $name, $value, $vocabulary_id, $descripti
$options
=
array
();
if
(
$blank
)
{
$options
[
''
]
=
$blank
;
$options
[
0
]
=
$blank
;
}
if
(
$tree
)
{
foreach
(
$tree
as
$term
)
{
...
...
modules/taxonomy/taxonomy.test
View file @
939a1f01
...
...
@@ -595,6 +595,9 @@ class TermEditTestCase extends DrupalWebTestCase {
'name'
=>
$this
->
randomName
(
12
),
'description'
=>
$this
->
randomName
(
100
),
);
// Explictly set the parents field to 'root', to ensure that
// taxonomy_form_term_submit() handles the invalid term ID correctly.
$edit
[
'parent[]'
]
=
0
;
// Create the term to edit (adding to the default 'Tags' vocabulary).
$this
->
drupalPost
(
'admin/content/taxonomy/1/add/'
,
$edit
,
t
(
'Save'
));
...
...
Write
Preview
Supports
Markdown
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