AEM Assets - Sort by modified feature is not working in AEM 6.5.12 | Community
Skip to main content
Level 3
September 17, 2022
Solved

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

  • September 17, 2022
  • 4 replies
  • 2474 views

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

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

4 replies

Ravi_Pampana
Community Advisor
Community Advisor
September 17, 2022

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

Level 3
September 17, 2022

Hi Ravi,

 

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

Sachin_Arora_
Community Advisor
Community Advisor
September 18, 2022

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

Level 3
September 18, 2022

Hi @sachin_arora_ ,

 

Added server logs in the question. Any idea??

Sachin_Arora_
Community Advisor
Community Advisor
September 19, 2022
joerghoh
Adobe Employee
Adobe Employee
September 20, 2022

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

 

 

 

girishb83316758AuthorAccepted solution
Level 3
September 20, 2022

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

Level 2
March 29, 2023

I also facing this issue your answer works 
Thank you