From 51983aad8ff0e7148836f0bd33b758ea4489c9cf Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Wed, 21 May 2025 14:19:43 +0900 Subject: [PATCH] Restore default success callback of ajaxForm() so that successful messages are printed --- common/js/common.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/common/js/common.js b/common/js/common.js index 5fc4e1b20..49fc7fb3e 100644 --- a/common/js/common.js +++ b/common/js/common.js @@ -514,7 +514,7 @@ Rhymix.ajaxSuccessHandler = function(xhr, textStatus, action, data, params, succ // If the response contains a redirect URL, follow the redirect. if (data.redirect_url) { - this.redirectToUrl(data.redirect_url.replace(/&/g, "&")); + this.redirectToUrl(data.redirect_url.replace(/&/g, '&')); return; } }; @@ -595,7 +595,14 @@ Rhymix.ajaxForm = function(form, success, error) { } else if (success && window[success] && $.isFunction(window[success])) { success = window[success]; } else { - success = null; + success = function(data) { + if (data.message && data.message !== 'success') { + alert(data.message); + } + if (data.redirect_url) { + Rhymix.redirectToUrl(data.redirect_url.replace(/&/g, '&')); + } + }; } } if (typeof error === 'undefined') {