Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
fix success message disabling
@@ -22,6 +22,7 @@ import com.liferay.portal.kernel.servlet.ServletResponseUtil;
import com.liferay.portal.kernel.servlet.SessionErrors;
import com.liferay.portal.kernel.servlet.SessionMessages;
import com.liferay.portal.kernel.util.ContentTypes;
+import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.JavaConstants;
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.StringPool;
@@ -168,6 +169,20 @@ public class PortletAction extends Action {
protected void addSuccessMessage(
ActionRequest actionRequest, ActionResponse actionResponse) {
+ HttpServletRequest request = PortalUtil.getHttpServletRequest(
+ actionRequest);
+
+ PortletConfig portletConfig = (PortletConfig)request.getAttribute(
+ JavaConstants.JAVAX_PORTLET_CONFIG);
+
+ boolean addProcessActionSuccessMessage = GetterUtil.getBoolean(
+ portletConfig.getInitParameter("add-process-action-success-action"),
+ true);
+
+ if (!addProcessActionSuccessMessage) {
+ return;
+ }
+
String successMessage = ParamUtil.getString(
actionRequest, "successMessage");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.