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
e0c7c0e3
Commit
e0c7c0e3
authored
Nov 06, 2007
by
Gábor Hojtsy
Browse files
#180109
by JirkaRybka: overcome browser quirk to detect when no taxonomy term was selected
parent
5f09149c
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/taxonomy/taxonomy.module
View file @
e0c7c0e3
...
...
@@ -346,11 +346,10 @@ function taxonomy_del_term($tid) {
function
taxonomy_form
(
$vid
,
$value
=
0
,
$help
=
NULL
,
$name
=
'taxonomy'
)
{
$vocabulary
=
taxonomy_vocabulary_load
(
$vid
);
$help
=
(
$help
)
?
$help
:
$vocabulary
->
help
;
if
(
$vocabulary
->
required
)
{
$blank
=
0
;
}
else
{
$blank
=
'<'
.
t
(
'none'
)
.
'>'
;
$blank
=
0
;
if
(
!
$vocabulary
->
multiple
)
{
$blank
=
(
$vocabulary
->
required
)
?
t
(
'- Please choose -'
)
:
t
(
'- None selected -'
);
}
return
_taxonomy_term_select
(
check_plain
(
$vocabulary
->
name
),
$name
,
$value
,
$vid
,
$help
,
intval
(
$vocabulary
->
multiple
),
$blank
);
...
...
@@ -895,7 +894,7 @@ function _taxonomy_term_select($title, $name, $value, $vocabulary_id, $descripti
$options
=
array
();
if
(
$blank
)
{
$options
[
0
]
=
$blank
;
$options
[
''
]
=
$blank
;
}
if
(
$tree
)
{
foreach
(
$tree
as
$term
)
{
...
...
@@ -905,10 +904,6 @@ function _taxonomy_term_select($title, $name, $value, $vocabulary_id, $descripti
$options
[]
=
$choice
;
}
}
if
(
!
$blank
&&
!
$value
)
{
// required but without a predefined value, so set first as predefined
$value
=
$tree
[
0
]
->
tid
;
}
}
return
array
(
'#type'
=>
'select'
,
...
...
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