#994870 by sun: Fixed Custom #type machine_name 'exists' callbacks cannot access other form elements/values

merge-requests/26/head
Angie Byron 2011-01-03 00:26:47 +00:00
parent e9464525ed
commit 4a8df419ab
1 changed files with 1 additions and 1 deletions

View File

@ -3368,7 +3368,7 @@ function form_validate_machine_name(&$element, &$form_state) {
// Verify that the machine name is unique.
if ($element['#default_value'] !== $element['#value']) {
$function = $element['#machine_name']['exists'];
if ($function($element['#value'])) {
if ($function($element['#value'], $form_state)) {
form_error($element, t('The machine-readable name is already in use. It must be unique.'));
}
}