Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293174

#limit_validation_errors seems ignored inside custom validation function when used on AJAX button

$
0
0

Site with only mymodule and views (with dependences) enabled beside core modules.

If my validation function looks like this:

<?php
function mymodule_form_validate($form, &$form_state) {
 
// ...
 
form_set_error($element, $error);
 
// ...
}
?>

errors are set during ajax call even if the button in question has
<?php
     
'#limit_validation_errors'=> array(),
     
'#submit'=> array(),
?>

However, if I write it like this:

<?php
function mymodule_form_validate($form, &$form_state) {
 
$limit_validation_errors = $form_state['clicked_button']['#limit_validation_errors'];
 
// ...
 
form_set_error($element, $error, $limit_validation_errors);
 
// ...
}
?>

it works just as it's supposed to.

Am I doing something wrong, or is there a bug somewhere?


Viewing all articles
Browse latest Browse all 293174

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>