AEM Assets - Sort by modified feature is not working in AEM 6.5.12 | Community
Skip to main content
Level 3
Sep 17, 2022 6:39 PM UTC
Solved

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

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.

 

@joerghoh 

 

Thank You,

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
girishb83316758Accepted solution
Level 3
Sep 20, 2022 5:19 PM UTC

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

8 replies

girishb83316758AuthorAccepted solution
Level 3
Sep 20, 2022 5:19 PM UTC

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

Translate
Level 2
Mar 29, 2023 10:04 AM UTC

I also facing this issue your answer works 
Thank you

Translate
joerghoh
Employee
Sep 20, 2022 5:15 PM UTC

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).

 

 

 

Translate
Sachin_Arora_
New Participant
Sep 18, 2022 8:07 AM UTC

@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.

Translate
Level 3
Sep 18, 2022 5:23 PM UTC

Hi @sachin_arora_ ,

 

Added server logs in the question. Any idea??

Translate
Sachin_Arora_
New Participant
Sep 19, 2022 5:59 AM UTC
Ravi_Pampana
New Participant
Sep 17, 2022 7:50 PM UTC

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

Translate
Level 3
Sep 17, 2022 8:28 PM UTC

Hi Ravi,

 

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

Translate