Skip to content

Commit

Permalink
pkp/pkp-lib#10050 [main] Error handling in SubmissionWizard crashes (#…
Browse files Browse the repository at this point in the history
…443)

* pkp/pkp-lib#10050 Add missing parameter when using ajaxErrorCallback method

* pkp/pkp-lib#10050 Assign default value to response object param for ajaxErrorCallback method

* pkp/pkp-lib#10050 Fix modal error not showing when an issue happens after creating new submission
  • Loading branch information
blesildaramirez authored Nov 20, 2024
1 parent ac20ff1 commit 1104bbe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/components/Container/SubmissionWizardPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -643,12 +643,13 @@ export default {
'X-Http-Method-Override': 'PUT',
},
error(r) {
close();
if (!r.responseJSON) {
this.ajaxErrorCallback();
this.ajaxErrorCallback({});
} else {
this.errors = r.responseJSON;
}
close();
},
success() {
window.location = this.submissionWizardUrl;
Expand Down Expand Up @@ -767,7 +768,7 @@ export default {
},
error(r) {
if (!r.responseJSON) {
this.ajaxErrorCallback();
this.ajaxErrorCallback({});
} else {
this.errors = r.responseJSON;
}
Expand Down
2 changes: 1 addition & 1 deletion src/mixins/ajaxError.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default {
*
* @param {Object} r The response from jQuery's ajax request
*/
ajaxErrorCallback(r) {
ajaxErrorCallback(r = {}) {
// If the user browses away from the page before a response has been
// received by the ajax request, the error handler will be invoked.
// Do nothing so the user does not see an obsolete error message.
Expand Down

0 comments on commit 1104bbe

Please sign in to comment.