-
-
Notifications
You must be signed in to change notification settings - Fork 816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better feedback when Records can't be saved. #5801
Better feedback when Records can't be saved. #5801
Conversation
if ($this->app['request']->isXmlHttpRequest()) { | ||
$response = ['error' => ['message' => 'Redirect detected. Check if you are still logged on.'] ]; | ||
return new JsonResponse($response, 500); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong approach mate. This will affect all AJAX requests requiring a redirect and none would be valid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, all 'ajaxy' requests that will redirect will fail silently. What happens is that it gets redirected, and returns an HTML page of the login screen, with a 200
status. As far as I can tell these just fail silently, and in javascript the .done()
or .success()
will be triggered, which is not correct.
This change will send a 500, so in the requesting javascript it can be caught. At the very least it'll trigger the .fail()
method, allowing us to give feedback to the user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 for using proper error codes!
As mentioned in #5803, I've also updated the icon in the save button, to reflect a successful or failed save: Success: http://recordit.co/YBxyHjHC2J |
🎉 merging… |
Fixes #5788
Fixes #5803
When saving a record fails, you'll get a more visible error message now. See:
http://recordit.co/eeeYMiT986
Screenshot of an actual Bolt error occurring: