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.

  • October 16, 2015
  • 6 replies
  • 1517 views

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.
Best answer by Feike_Visser1

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

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

6 replies

Feike_Visser1
Adobe Employee
Adobe Employee
October 16, 2015

Are you using getTemplate()?

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.

Feike_Visser1
Adobe Employee
Feike_Visser1Adobe EmployeeAccepted solution
Adobe Employee
October 16, 2015

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

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

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.

Sham_HC
Level 10
October 16, 2015
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.