adobe / asset-share-commons

A modern, open-source asset share reference implementation built on Adobe Experience Manager (AEM)
https://opensource.adobe.com/asset-share-commons/
Apache License 2.0
88 stars 107 forks source link

Asset share components are not working in publisher #867

Closed jmzcray closed 1 year ago

jmzcray commented 1 year ago

UPDATE: Fixed in v2.4.6

Firstly, our current setup: AEM: 6.5.14 asset share commons: 2.4.4 WCM core components: 2.21.2

The problem we are having now is limited to publisher only. All the asset share components aren't working and it seems to be related to unable to get userProfile from /libs/granite/security/currentuser.json.

In the the browser developer console, it is throwing an error of: Uncaught TypeError: Cannot read properties of undefined (reading 'get')

in this file: https://github.com/adobe/asset-share-commons/blob/develop/ui.apps/src/main/content/jcr_root/apps/asset-share-commons/clientlibs/clientlib-site/js/profile.js#L41

Is there anything to resolve this? Is it related to how AEM publisher needs ?sling:authRequestLogin=1 to login to publisher?

davidjgonzalez commented 1 year ago

![2022-12-06 at 10 27 AM](https://user-image@jmzcray thubusercontent.com/1451868/205953572-789cf292-3d2a-4f2d-a92f-5a3dc78adf43.png)

@jmz i tried this with latest ASC (2.4.6) and AEM 6.5.14 on my local, and it seems to work - see image above.

Im not sure why/how youre getting version 3.0.7 of ASC - the latest is 2.4.6; can you try with 2.4.6 (available on maven central and on this Github project)

Thanks!

jmzcray commented 1 year ago

My apologies! The ASC version that was installed is 2.4.4 instead...

davidjgonzalez commented 1 year ago

Can you check if 'jQuery' is a global object? (Check if that var exists in the window by typing it into your browser console).. I think that error is saying that jquery is undefined .. which would definitely break a lot of stuff

jmzcray commented 1 year ago

Yes, jQuery is undefined and I am not sure why...

If I revert ASC back to 1.8.0 everything works again.

jmzcray commented 1 year ago

I think it relates to this error in the browser developer console: No suitable store implementation found for type: "contexthub.assetsharecommonscart".

But I can't find anything that address this anywhere...

jmzcray commented 1 year ago

Update, I can see a reference to "contexthub.assetsharecommonscart" in node: /etc/cloudsettings/asset-share-commons/contexthub/cart

However, that node is created from ASC 1.8.0.

In ASC 2.4.4 there is nothing equivalent to that. So far, I can't see anywhere on where to address this issue when upgrading from 1.x to 2.x for ASC...

jmzcray commented 1 year ago

Update:

I've uninstall ASC 2.4.4 and 1.8.0, then reinstall ASC 2.4.4 and the problem still exist...

This time, there is no error about "contexthub.assetsharecommonscart".

The error now (which also present before uninstalling 1.8.0 and reinstalling 2.4.4) in the browser developer console is: clientlib-dependencies.min.js:142 Uncaught TypeError: Cannot read properties of undefined (reading 'html5')

pointing at the code in modernizr-2.8.3.min.js at: https://github.com/Modernizr/Modernizr/blob/v2.8.3/modernizr.js#L1016

Is there anyone else that can help?

jmzcray commented 1 year ago

ok... looks like my issue is related to: https://github.com/adobe/asset-share-commons/issues/856

davidjgonzalez commented 1 year ago

@jmzcray ah yes! 2.4.6 should fix that -- sorry about that one!