⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Validation error output causes error



indrawan
  • profile picture
  • Member

Posted 18 February 2017 - 15:26 PM

I have a simple validation:

$crud->setRule('type', 'in', array('P', 'S'));

$output = $crud->render();

if ($output->isJSONResponse) {
    header('Content-Type: application/json; charset=utf-8');
    echo $output->output;
    exit;
}

$css_files = $output->css_files;
$js_files = $output->js_files;
$output = $output->output;

...

When the validation failed, here is what I got:

(see the attachment)

 

The xdebug was ON, but it was not the issue. At the end of the response was this message:

{"status":"error","errors":{"type":["Type contains invalid value"]}}

 

which should be displayed somehow instead of the "Something went wrong!" popup.

 

Please help. Thank you.