Summary: While testing a feature we are working on, we found a few places where alert messages sent to the user don't contain the custom error message.
Steps to reproduce:
As a super user, open a book where you are not a book user
Go to Content tab and select Add new page
Add title and body and click "Save"
Behavior expected: Error message alert with text: "Something went wrong while attempting to save: You do not have permission to modify this book".
Behavior observed: Error message alert with text : "Something went wrong while attempting to save: object Object"
The pattern that I see elsewhere for this kind of message reporting is message.responseJSON.error.message[0].value; which gets the message contents from the jqXHR response object, and I can submit that as a pr with the fixes for the other error message reporting bug if that looks good to you.
Summary: While testing a feature we are working on, we found a few places where alert messages sent to the user don't contain the custom error message.
Steps to reproduce:
Behavior expected: Error message alert with text: "Something went wrong while attempting to save: You do not have permission to modify this book". Behavior observed: Error message alert with text : "Something went wrong while attempting to save: object Object"
Message contents are here: https://github.com/anvc/scalar/blob/a9165f1fc34d0834b911c11757b92fc47b9d15bf/system/application/views/arbors/html5_RDFa/js/form-validation.js#L301 and here: https://github.com/anvc/scalar/blob/a9165f1fc34d0834b911c11757b92fc47b9d15bf/system/application/controllers/api.php#L111
The pattern that I see elsewhere for this kind of message reporting is
message.responseJSON.error.message[0].value;
which gets the message contents from the jqXHR response object, and I can submit that as a pr with the fixes for the other error message reporting bug if that looks good to you.