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
635cf5eb
Commit
635cf5eb
authored
Feb 02, 2006
by
Steven Wittens
Browse files
-
#39179
: Allow skipping of option validation for selects
parent
d96be836
Changes
1
Hide whitespace changes
Inline
Side-by-side
includes/form.inc
View file @
635cf5eb
...
...
@@ -153,8 +153,8 @@ function _form_validate($elements, $form_id = NULL) {
form_error
(
$elements
,
t
(
'%name field is required.'
,
array
(
'%name'
=>
$elements
[
'#title'
])));
}
// Add legal choice check if element has #options.
if
(
isset
(
$elements
[
'#options'
])
&&
isset
(
$elements
[
'#value'
]))
{
// Add legal choice check if element has #options.
Can be skipped, but then you must validate your own element.
if
(
isset
(
$elements
[
'#options'
])
&&
isset
(
$elements
[
'#value'
])
&&
!
isset
(
$elements
[
'#DANGEROUS_SKIP_CHECK'
])
)
{
$message
=
t
(
'Illegal choice in %title.'
,
array
(
'%title'
=>
theme
(
'placeholder'
,
$elements
[
'#title'
])));
if
(
$elements
[
'#type'
]
==
'select'
)
{
$options
=
form_options_flatten
(
$elements
[
'#options'
]);
...
...
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