Clientlib is pulled in twice | Community
Skip to main content
Level 3
December 6, 2016

Clientlib is pulled in twice

  • December 6, 2016
  • 2 replies
  • 5210 views

I've taken the adhocassetshare folder from /libs and made a copy inside /apps so that I now have " apps/dam/gui/components/admin/adhocassetshare "

 

Inside of /apps/dam/gui/components/admin/adhocassetshare/clientlibs/landingpage/js/landingpage.js I put console.log('test'); inside the first few lines, like so:

(function (document, $) { "use strict"; console.log('test'); function createModal(modalId, modalHeader) {

 

When I view the browser console, I see two "tests", one from shareembedded.js:93229, and another from shareembedded.js:93473 

For some reason, this file appears to be included twice. Is there any way I can find the cause and stop this from happening?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

smacdonald2008
Level 10
December 6, 2016

Try changing the name of the clientlib in your overlayed component and ensure you update the name of it in the component - there should be no link back to the original client lib. 

Level 3
December 6, 2016

smacdonald2008 wrote...

Try changing the name of the clientlib in your overlayed component and ensure you update the name of it in the component - there should be no link back to the original client lib. 

 

I'm not sure what you're referring to. I don't think I have an overlayed component. I just copied the folder and structure from /libs into /apps and begun modifying my copy in apps.

Also, if it were hitting the original client lib, it shouldn't be logging "console.log('test')", since that code only appears in the version in /apps, right?

Nupur_Jain
Adobe Employee
Adobe Employee
December 7, 2016

What I can possibly think of is that you have copied the content from libs to apps i.e now there are two clientlib folders

1. /libs/dam/gui/components/admin/adhocassetshare/clientlibs/shareembeddedpreview

2. /apps/dam/gui/components/admin/adhocassetshare/clientlibs/shareembeddedpreview

with category : embeddedadhocassetsharepreview

This category embed your landing page clientlib : dam.gui.adhocshare.sharepage

Somewhere in your page you are including clientlib :  embeddedadhocassetsharepreview

now, since there are two clientlib folder 'shareembeddedpreview' ,both embedding the landing page clientlib, that is how you are getting same console code twice in actual  shareembedded.js created.

Hope this helps!

 

Thanks,

Nupur

Level 3
December 7, 2016

nupurj17891248 wrote...

What I can possibly think of is that you have copied the content from libs to apps i.e now there are two clientlib folders

1. /libs/dam/gui/components/admin/adhocassetshare/clientlibs/shareembeddedpreview

2. /apps/dam/gui/components/admin/adhocassetshare/clientlibs/shareembeddedpreview

with category : embeddedadhocassetsharepreview

This category embed your landing page clientlib : dam.gui.adhocshare.sharepage

Somewhere in your page you are including clientlib :  embeddedadhocassetsharepreview

now, since there are two clientlib folder 'shareembeddedpreview' ,both embedding the landing page clientlib, that is how you are getting same console code twice in actual  shareembedded.js created.

Hope this helps!

 

Thanks,

Nupur

 

I've deleted everything I don't need for this customization. "/apps/dam/gui/components/admin/adhocassetshare/clientlibs/shareembeddedpreview" is now gone.

The two files I need to edit are:


/apps/dam/gui/components/admin/adhocassetshare/childasset/link.jsp
/apps/dam/gui/components/admin/adhocassetshare/clientlibs/landingpage/js/landingpage.js

My apps directory looks like this:

The problem is still happening