I meet another problem with "An error has been occured on saving" message. Spending some hours i resolved it:
If all fields validated correctly - no prob, but if some of them not perform any rules - i receive "An error has..."
Cause of this message - NOT success on ajax response. I look at error field of response and saw "Uncaught SyntaxError: Unexpected token \."
I use utf8 and my response from server look like:
[quote][color=#000000][font=Consolas,]{"success":false,"error_message":"[/font][/color][color=#881280][font=Consolas,]<[/font][/color][color=#881280][font=Consolas,]p[/font][/color][color=#881280][font=Consolas,]>[/font][/color][color=#000000][font=Consolas,]\u041f\u043e\u043b\u0435 "\u0421\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u043e\u0435 \u0438\u043c\u044f" \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.[/font][/color][color=#881280][font=Consolas,]<[/font][/color][color=#881280][font=Consolas,]\/p[/font][/color][color=#881280][font=Consolas,]>[/font][/color][color=#000000][font=Consolas,]\n","error_fields":{"uriname":"\u041f\u043e\u043b\u0435 "\u0421\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u043e\u0435 \u0438\u043c\u044f" \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f."}}[/font][/color][/quote]
parser cant read such string as json and think that its bad response.
Solution: Use htmlentities($message, ENT_NOQUOTES,'UTF-8') for all data that sending by json.
For example i change in grocery_crud.php (line 1737)
protected function validation_layout($validation_result)
{
@ob_end_clean();
echo "<textarea>".json_encode($validation_result)."</textarea>";
$this->set_echo_and_die();
}
to
protected function validation_layout($validation_result)
{
@ob_end_clean();
echo "<textarea>".htmlentities(json_encode($validation_result), ENT_NOQUOTES,'UTF-8')."</textarea>";
$this->set_echo_and_die();
}