AEM 5.6.1 currentPage object is null on publish server. | Community
Skip to main content
Level 2
October 16, 2015
Solved

AEM 5.6.1 currentPage object is null on publish server.

Hi,

I hope you can help.

We are currently in the middle of upgrading from 5.4 to 5.6.1 and its all gone quite smoothly with the testing in the authoring environment. However, when the components are deployed to the publish server there are a lot of exceptions thrown. On referring back to the code all the lines in question seem to be using currentPage in some way.

Has anybody had an experience like this? Or know why currentPage appears to be null.

Regards

Damian.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Feike_Visser1
Feike_Visser1Accepted solution
Employee
October 16, 2015

Yes, getTemplate() shouldn't be used anymore on publish since 5.5...

use getProperties().get("cq:template","")

6 replies

Feike_Visser1
Employee
October 16, 2015

Are you using getTemplate()?

Translate
DPMAuthor
Level 2
October 16, 2015

Yes, it seems to complain about that in most cases. However it does seem to complain about pageHelper.getClasses(currentPage). Which is why i moved my investigation from templates to the currentPage object.

Translate
Feike_Visser1
Feike_Visser1Accepted solution
Employee
October 16, 2015

Yes, getTemplate() shouldn't be used anymore on publish since 5.5...

use getProperties().get("cq:template","")

Translate
DPMAuthor
Level 2
October 16, 2015

Thanks, I'll update that. It does work in our auth environment though, and there is the other issue so I'm not sure it's the root cause.

Translate
Sham_HC
Level 10
October 16, 2015

That is the cause & agree with Feike.  http://blogs.adobe.com/livecycle/2012/06/developers-faq-on-cq5-5.html

Translate
DPMAuthor
Level 2
October 16, 2015

Ahh, I see its down to being an anonymous user which explains why it works in auth.

 

Thanks alot guys.

Translate