diff --git a/modules/apps/layout/layout-page-template-admin-web/src/main/java/com/liferay/layout/page/template/admin/web/internal/portlet/action/DeleteLayoutPageTemplateEntryMVCActionCommand.java b/modules/apps/layout/layout-page-template-admin-web/src/main/java/com/liferay/layout/page/template/admin/web/internal/portlet/action/DeleteLayoutPageTemplateEntryMVCActionCommand.java index 6a8099852be45d..6ce9051df79939 100644 --- a/modules/apps/layout/layout-page-template-admin-web/src/main/java/com/liferay/layout/page/template/admin/web/internal/portlet/action/DeleteLayoutPageTemplateEntryMVCActionCommand.java +++ b/modules/apps/layout/layout-page-template-admin-web/src/main/java/com/liferay/layout/page/template/admin/web/internal/portlet/action/DeleteLayoutPageTemplateEntryMVCActionCommand.java @@ -102,15 +102,21 @@ protected void doProcessAction( hideDefaultErrorMessage(actionRequest); } - else if (deleteLayoutPageTemplateEntryIds.length > 0) { - hideDefaultSuccessMessage(actionRequest); - - MultiSessionMessages.add( - actionRequest, "displayPageTemplateDeleted", - _language.format( - _portal.getHttpServletRequest(actionRequest), - "you-successfully-deleted-x-display-page-templates", - new Object[] {deleteLayoutPageTemplateEntryIds.length})); + else { + int total = + deleteLayoutPageTemplateEntryIds.length - + deleteLayoutPageTemplateIdsList.size(); + + if (total > 0) { + hideDefaultSuccessMessage(actionRequest); + + MultiSessionMessages.add( + actionRequest, "displayPageTemplateDeleted", + _language.format( + _portal.getHttpServletRequest(actionRequest), + "you-successfully-deleted-x-display-page-templates", + new Object[] {total})); + } } sendRedirect(actionRequest, actionResponse);