Issue with Asset details components | Community
Skip to main content
Level 6
July 7, 2022
Solved

Issue with Asset details components

  • July 7, 2022
  • 1 reply
  • 708 views

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.

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.

 

 

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 lukasz-m

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.

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:

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

1 reply

lukasz-m
Community Advisor
lukasz-mCommunity AdvisorAccepted solution
Community Advisor
July 10, 2022

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.

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:

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