[MAGNOLIA-643] cms:publicOnly showInPreview=true throws ClassCastException Created: 17/Feb/06 Updated: 23/Jan/13 Resolved: 01/Mar/06 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | taglibs |
| Affects Version/s: | 2.1.4 |
| Fix Version/s: | 2.1.5 |
| Type: | Bug | Priority: | Major |
| Reporter: | Andreas Brenk | Assignee: | Boris Kraft |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | 5m | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | 5m | ||
| Attachments: |
|
| Template: |
|
| Acceptance criteria: |
Empty
|
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
| Date of First Response: |
| 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$ 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))) { |
| Comments |
| Comment by Andreas Brenk [ 17/Feb/06 ] |
|
svn diff src/main/info/magnolia/cms/taglibs/PublicOnly.java |
| Comment by Philipp Bracher [ 01/Mar/06 ] |
|
patched |