Jump to content


Validation error output causes error

validation

  • Please log in to reply
No replies to this topic

#1 indrawan

indrawan

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 18 February 2017 - 03: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.

 

Attached Thumbnails

  • Noname.jpg






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users