Details
-
Bug
-
Resolution: Fixed
-
Major
-
2.1.4
-
None
Description
The cms:publicOnly tag does not work as documented. If showInPreview is set to true it nevertheless does not evaluate its body content on an admin instance in preview mode.
The guilty lines are
String prev = (String) request.getSession().getAttribute("mgnlPreview"); //$NON-NLS-1$
if (!Server.isAdmin() || (prev != null && showInPreview)) {
in PublicOnly#condition(). The session attribute "mgnlPreview" is a Boolean and not a String so a ClassCastException occurs.
The corrected lines should read
if (!Server.isAdmin() || (showInPreview && Resource.showPreview(request))) {
Checklists
Acceptance criteria