asset-share-commons icon indicating copy to clipboard operation
asset-share-commons copied to clipboard

Download, Share and Cart buttons are not working in Asset Share Commons Publish page

Open anjuathakur opened this issue 3 years ago • 9 comments

Download, Share and Cart buttons are not working in Asset Share Commons Publish page while it is working fine in Author Instance of AEMaaCS

We have tried below solutions to resolve it but its not working

Checked read permissions (to the everyone user for the anonymous use case) on:

/conf/xxx/wcm/settings/templates /conf/xxx/wcm/settings/policies /etc/cloudsettings

Checked the dispatcher codes Published the pages/templates

Its a blocker for us and impacting the production go live

anjuathakur avatar May 17 '22 16:05 anjuathakur

Kindly confirm if you have faced this in past or have some guidance around the solution

anjuathakur avatar May 18 '22 03:05 anjuathakur

hi @anjuathakur can you expand on not working? Is it a 404 error for the partial modal .html request or is it a javascript error? Can you share the browser console and the network requests tab using dev tools?

godanny86 avatar May 18 '22 03:05 godanny86

Hi @godanny86, there are no errors in console Here are the issues: AUTHOR:

  1. The assets  share details are displayed when clicking the SHARE button.
  2. Cart modal contains the details of the assets that are added to the cart.
  3. DOWNLOAD button is working.    image image

PUBLISH:

  1. The assets  share details are missing when clicking the SHARE button.
  2. Cart modal is empty.
  3. DOWNLOAD button is not working. image image

Here's Network tab when clicking share button: image

Jaski96 avatar May 18 '22 06:05 Jaski96

What version of AEMaaCS? What version of AssetShare Commons?

Can you look at the parameters of the POST request to the .partial.html? Are the asset paths being sent?

godanny86 avatar May 18 '22 19:05 godanny86

The payload for the POST request for Cart, Download, Share should all look something similar to this:

image

godanny86 avatar May 18 '22 20:05 godanny86

Assuming a list of paths is being sent, i have to image they're not able to be converted to AssetModels in this logic:

https://github.com/adobe/asset-share-commons/blob/master/core/src/main/java/com/adobe/aem/commons/assetshare/components/actions/impl/ActionHelperImpl.java#L54-L63

        return Arrays.stream(requestParameters)
                    .filter(Objects::nonNull)
                    .map(RequestParameter::getString)
                    .filter(StringUtils::isNotBlank)
                    .map(path -> Text.unescape(path))
                    .map(path -> request.getResourceResolver().getResource(path))
                    .filter(Objects::nonNull)
                    .map(resource -> modelFactory.getModelFromWrappedRequest(request, resource, AssetModel.class))
                    .filter(Objects::nonNull)
                    .collect(Collectors.toList());

davidjgonzalez avatar May 18 '22 21:05 davidjgonzalez

Hi @godanny86, We are using ASC v2.2.0-1 The payload for the POST request for Cart, Download, Share is same for us. image

Jaski96 avatar May 19 '22 05:05 Jaski96

hmm, that looks right. There must be something on the server side where those Assets aren't being resolved to an Asset Model. Does this happen on a local publish instance using the AEM quickstart SDK?

Also what version of CS are you running?

godanny86 avatar May 20 '22 15:05 godanny86

@Jaski96 Were you able to uncover anything else WRT this issue?

davidjgonzalez avatar May 31 '22 12:05 davidjgonzalez

Closing - but please re-open if you are still experiencing this problem/can provide more details.

davidjgonzalez avatar Sep 14 '22 01:09 davidjgonzalez