Skip to content
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

Merged
merged 3 commits into from
Sep 22, 2016

Conversation

bobdenotter
Copy link
Member

@bobdenotter bobdenotter commented Sep 21, 2016

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:

screen shot 2016-09-21 at 15 54 54

if ($this->app['request']->isXmlHttpRequest()) {
$response = ['error' => ['message' => 'Redirect detected. Check if you are still logged on.'] ];
return new JsonResponse($response, 500);
}
Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Contributor

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!

@bobdenotter bobdenotter changed the title Better feedback when Records can't be saved. [WIP] Better feedback when Records can't be saved. Sep 21, 2016
@bobdenotter
Copy link
Member Author

As mentioned in #5803, I've also updated the icon in the save button, to reflect a successful or failed save:

Failure: screen shot 2016-09-21 at 17 50 12

Success: http://recordit.co/YBxyHjHC2J

@bobdenotter bobdenotter changed the title [WIP] Better feedback when Records can't be saved. Better feedback when Records can't be saved. Sep 21, 2016
@bobdenotter bobdenotter mentioned this pull request Sep 21, 2016
@GwendolenLynch
Copy link
Contributor

🎉 merging…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants