[MGNLUI-1902] cmsfn.isPreviewMode() is always false Created: 24/Jun/13 Updated: 13/Sep/21 Resolved: 09/Aug/13 |
|
| Status: | Closed |
| Project: | Magnolia UI |
| Component/s: | page editor |
| Affects Version/s: | 5.0 |
| Fix Version/s: | 5.0.2, 5.1 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Maik Jablonski | Assignee: | Federico Grilli |
| Resolution: | Fixed | Votes: | 3 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| 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 |
|
cmsfn.isPreviewMode() returns always false, accordingly cmsfn.isEditMode() is always true, so there's no way to decide if in preview mode or not at the moment. Same for JSP and FTL templating. Tested against Magnolia 5.0 from bundled tomcat download. |
| Comments |
| Comment by Federico Grilli [ 31/Jul/13 ] |
|
Thanks for reporting it. Confirmed on 5.0.1 too |
| Comment by Federico Grilli [ 31/Jul/13 ] |
|
After a quick investigation it turned out that the preview mode is set here info.magnolia.cms.filters.InterceptFilter.doFilter(HttpServletRequest, HttpServletResponse, FilterChain) but the mgnlPreview request parameter which used to be sent to the server in Magnolia 4.x now is no longer there (hence null which converted into a boolean gives false), the edited page being currently in an iframe which only sends the mgnlChannel param. |
| Comment by Roman Kovařík [ 14/Aug/13 ] |
|
Shouldn't cmsfn.isPreviewMode() be true also for accessing the page without editor (http://demoauthor.magnolia-cms.com/demo-project.html)? |
| Comment by Cedric Reichenbach [ 28/Sep/13 ] |
|
It's back in 5.1-rc! |
| Comment by Hugo Ferreira [ 27/Apr/15 ] |
|
I was dealing with this function now and I just realised that cmsfn.isPreviewMode() == !cmsfn.isEditMode() (I mean, the result is the same) |