Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

CQ 5.6.1: Issue with Page.listChildren

Avatar

Level 2

Hi, I hope you can help.

We care currently upgrading from 5.4 to 5.6.1, and everything has been going mostly fine till we published a couple of components to the publish server that use Page.listChildren to generate menus automatically.

The pages the components are looing at are in /content so I can't see why this would be an issue even with the new permissions rescrtictrions. The components also use isValid & isHideInNav to build the menu.

Everything works fine in preview, so I am assuming it's something to do with permission for the anonymous user.

Has anybody had any similar issues?

Regards

Damian.

1 Accepted Solution

Avatar

Correct answer by
Level 2

The issue was with checking if the page is activated. It was always returning false for the publish server. I guess since this is pretty much redundant as it must be activated to be there I change the condition to check if it was on publish as well.

 

-D

View solution in original post

3 Replies

Avatar

Level 2

After testing its nothing to do with the permissions of the anonymous user. After granting the anonymous user on publish admin right it still could not show child pages, and on the reverse a user with the same rights as the anonymous user in auth can still see child pages.

The only difference between how I use listChildren and how it is used in CQ foundation components is that I always do an isHideInNav and isValid check before display.

I'm hoping to be granted permissions on publish diagnose this issue as its a long process otherwise.

Regards

Damian.

Avatar

Correct answer by
Level 2

The issue was with checking if the page is activated. It was always returning false for the publish server. I guess since this is pretty much redundant as it must be activated to be there I change the condition to check if it was on publish as well.

 

-D

Avatar

Level 10

Thank you for posting what the issue was.