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

AEM Assets - Sort by modified feature is not working in AEM 6.5.12

Avatar

Level 4

Hi Everyone,

 

We recently upgrading AEM 6.5 to 6.5.12.

In Assets page ( /content/dam ), we have sort by option in the toolbar to sort the folder in the assets.

Sort by has options like name, created, modified.

 

Sort by name and created is working fine.

 

But sort by modified is not working. It gives error "Failed to load data". And this issue is only occurring in "/content/dam" path.

 

Other paths like "/content/dam/xyz" all the sort by options works perfectly fine.

 

Only at "/content/dam", sort by modified throws this error "Failed to load data".

 

Server logs:

 

/mnt/overlay/dam/gui/content/assets/jcr:content/views/card.0.20.html/content/dam HTTP/1.1] libs .granite.ui.components.coral.foundation.masonry.

 

Failed to wrap datasource  for lookahead

java.lang.NullpointerException: Null

 

at com.day.cq.dam.commons.sort.impl.ResourceSorterImpl$ModifiedTransformer.transform(ResourceSorterImpl.java:407)

 

 

what could be the reason for this issue? Please help.

 

@Jörg_Hoh 

 

Thank You,

1 Accepted Solution

Avatar

Correct answer by
Level 4

We figured out the root cause.

It was throwing error because inside /content/dam there was folder with jcr:primaryType as "nt:folder".

 

After removing that folder the issue got resolved.

 

The folder should be of type sling:folder

View solution in original post

8 Replies

Avatar

Community Advisor

Hi,

It might happen if the ajax call to sort is failing due to timeout or throws any errors. Check browser network tab when sort option is clicked

 

Below is the call when sorting using created

http://localhost:4502/mnt/overlay/dam/gui/content/assets/jcr:content/views/card.0.20.html/content/dam?sortName=created&sortDir=asc&_=1663444098346

Avatar

Level 4

Hi Ravi,

 

In console it just prints, Failed to load resource: server responded with a status of 500 ( Server error )

Avatar

Community Advisor

@girishb83316758  Please check the server logs. Server log file should have exact root cause. It looks like indexing issue as you are able to fetch result/run query in child folder properly.

Avatar

Employee Advisor

Please check with CRXDE the "jcr:primaryType" of /content/dam; it should be "sling:Folder". Then there should be a node "/content/dam/jcr:content", which has the property "jcr:primaryType" of "nt:unstructured" (plus a few other properties).

 

 

 

Avatar

Correct answer by
Level 4

We figured out the root cause.

It was throwing error because inside /content/dam there was folder with jcr:primaryType as "nt:folder".

 

After removing that folder the issue got resolved.

 

The folder should be of type sling:folder