Expand my Community achievements bar.

SOLVED

Issue with Asset details components

Avatar

Level 8

I have a maven project where in I added asset share commons dependencies. I created details-page template by refferring asset share commons details template type then I added structure policies, allowed componentsI added Asset Share Commons - Details  components.

Then I tried to drag details components on page level but its throwing error.

Vani1012_0-1657177758876.png

In logs I found this error

 *ERROR* [0:0:0:0:0:0:0:1 [1657017722129] GET /conf/my-asset-share/settings/wcm/templates/asset-deatails-template-for-my-asset-share-project/initial/jcr:content/root/main/responsivegrid/title.html HTTP/1.1] com.day.cq.wcm.core.impl.WCMDebugFilter Exception: Cannot get DefaultSlingScript: data-sly-call: expression evaluates to null.
org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: data-sly-call: expression evaluates to null.
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:510) [org.apache.sling.scripting.core:2.0.56]
    at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:552) [org.apache.sling.engine:2.6.18]
    at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:44) [org.apache.sling.engine:2.6.18]
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:82) [org.apache.sling.engine:2.6.18]
    at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilterWithErrorHandling(WCMDebugFilter.java:192) [com.day.cq.wcm.cq-wcm-core:5.12.90]
    at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:159) [com.day.cq.wcm.cq-wcm-core:5.12.90]
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72) [org.apache.sling.engine:2.6.18]
    at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:278) [com.day.cq.wcm.cq-wcm-core:5.12.90]
    at com.day.cq.wcm.core.impl.WCMComponentFilter.filterRootInclude(WCMComponentFilter.java:373) [com.day.cq.wcm.cq-wcm-core:5.12.90]
    at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:190) [com.day.cq.wcm.cq-wcm-core:5.12.90]
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72) [org.apache.sling.engine:2.6.18]
    at com.day.cq.wcm.core.impl.page.PageLockFilter.doFilter(PageLockFilter.java:91) [com.day.cq.wcm.cq-wcm-core:5.12.90]
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72) [org.apache.sling.engine:2.6.18]
    at com.day.cq.personalization.impl.TargetComponentFilter.doFilter(TargetComponentFilter.java:94) [com.day.cq.cq-personalization:5.12.36]
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72) [org.apache.sling.engine:2.6.18]
    at org.apache.sling.engine.impl.SlingRequestProcessorImpl.processComponent(SlingRequestProcessorImpl.java:282) [org.apache.sling.engine:2.6.18]
    at org.apache.sling.engine.impl.filter.RequestSlingFilterChain.render(RequestSlingFilterChain.java:49) [org.apache.sling.engine:2.6.18]
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:76) [org.apache.sling.engine:2.6.18]
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.6.18]
    at com.day.cq.wcm.core.impl.warp.TimeWarpFilter.doFilter(TimeWarpFilter.java:109) [com.day.cq.wcm.cq-wcm-core:5.12.90]
 
Can anyone help me on this issue
 
Thanks, 
Vani.

 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Vani1012,

This is expected behavior, base on a the fact how details page works. You will get exactly the same result on original Asset Details template that you get with Asset Share Commons packages. Have a look on below screen that is presenting Asset Details template from Asset Share Commons.

asset-details-page.jpg

The main reason of above issue is because Asset Details page strongly relys on specific asset context. Asset context is passed using suffix set in URL. Obviously, you do not have this information on template level, this is why you see the error. You can experiment and add path to some sample asset and observer the result. Here is an example, for Asset Details template from Asset Share Commons - I have added additional title component during this test, and used link to one of demo assets provided by Asset Share Commons package.

My URL looks like this:

and the result:

asset-details-template-suffix.jpg

As you can see after adding proper suffix, there is no error, and apart of that all available metadata from the asset are shown.

Here is link to the documentation that describes Asset Details page concept:

You can also raise an issue to Asset Share Commons development team via GitHub

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi @Vani1012,

This is expected behavior, base on a the fact how details page works. You will get exactly the same result on original Asset Details template that you get with Asset Share Commons packages. Have a look on below screen that is presenting Asset Details template from Asset Share Commons.

asset-details-page.jpg

The main reason of above issue is because Asset Details page strongly relys on specific asset context. Asset context is passed using suffix set in URL. Obviously, you do not have this information on template level, this is why you see the error. You can experiment and add path to some sample asset and observer the result. Here is an example, for Asset Details template from Asset Share Commons - I have added additional title component during this test, and used link to one of demo assets provided by Asset Share Commons package.

My URL looks like this:

and the result:

asset-details-template-suffix.jpg

As you can see after adding proper suffix, there is no error, and apart of that all available metadata from the asset are shown.

Here is link to the documentation that describes Asset Details page concept:

You can also raise an issue to Asset Share Commons development team via GitHub