Expand my Community achievements bar.

SOLVED

AEM 5.6.1 currentPage object is null on publish server.

Avatar

Level 2

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.

1 Accepted Solution

Avatar

Correct answer by
Employee

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

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

View solution in original post

6 Replies

Avatar

Level 2

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.

Avatar

Correct answer by
Employee

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

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

Avatar

Level 2

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.

Avatar

Level 2

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

 

Thanks alot guys.