Skip to content

Commit 9b416b9

Browse files
authored
Merge pull request #3 from vinc10/fix-ufalerts-initialization
Fix: Ensure ufAlerts is initialized in ufForm _defaultError method
2 parents 72c268c + 8c84075 commit 9b416b9

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

app/assets/userfrosting/js/uf-form.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,10 @@
225225
*/
226226
Plugin.prototype._defaultError = function (jqXHR, textStatus, errorThrown) {
227227
// Error messages
228+
if (!this.settings.msgTarget.data('ufAlerts')) {
229+
this.settings.msgTarget.ufAlerts();
230+
}
231+
228232
if (this._debugAjax && jqXHR.responseText) {
229233
this.$element.trigger('submitError.ufForm', [jqXHR, textStatus, errorThrown]);
230234
this.settings.msgTarget.ufAlerts('push', 'danger', jqXHR.responseJSON.description).ufAlerts('render');
@@ -428,4 +432,4 @@
428432
console.warn('Method ' + methodOrOptions + ' does not exist.');
429433
}
430434
};
431-
})(jQuery, window, document);
435+
})(jQuery, window, document);

0 commit comments

Comments
 (0)