Skip to main content
Level 3
Aug 16, 2023 11:16 PM UTC

Disable or Remove "Replace" button on Name Conflict pop-up

Hi,

i want to remove or disable the "Replace" button on the name conflict pop-up. any ideas of where to start? 

To recreate the scenario. In any assets folder, try to upload an asset which is already existing in the folder. in which case AEM will show you a pop-up which looks like this.

8 replies

Adilos-Cantuerk
Community Advisor
Community Advisor
Aug 21, 2023 2:39 PM UTC

Warning: I am not very good at this - somebody who understands this topic needs to elaborate / correct me before you put to much hope or effort into this answer.
It seems to me that there is a node in CRXDE 
/libs/dam/gui/content/bulkimport/wizard/jcr:content/body/items/form/items/wizard/items/import_config/items/fixedcolumns/items/fieldset/items/import_mode/items/replace
I would start there to look for the _coral-Dialog-footer in order to disable this
<button is="coral-button" variant="secondary" class="_coral-Button _coral-Button--secondary" size="M"><coral-button-label class="_coral-Button-label">Replace</coral-button-label></button>

Second warning:
You will have to make an overlay node in apps - since you should not change anything in libs.
Last warning: 
This might be not the right way to do it  - and i am very interested how you archieved this - if you are able to do it. 
Keep me updated.

Translate
ASP_CorpAuthor
Level 3
Aug 21, 2023 3:45 PM UTC

Hi Adilos, 

thank you for the response. i cannot find /libs/dam/gui/content/bulkimport/wizard... path in my crxde. iam i missing something?.

will definitely post if i have any updates.

Translate
Adilos-Cantuerk
Community Advisor
Community Advisor
Aug 22, 2023 7:52 AM UTC

I just checked in my local enviroment. It is there.
Please try to search within CRXDE for "REPLACE".
But - i say it again - this is my uneducated first guess. 

 

Translate
aanchal-sikka
Community Advisor
Community Advisor
Sep 7, 2023 4:41 PM UTC

The "Replace" and "Create Version" can be disabled by customizating canOverwrite() function in 

/libs/dam/gui/coral/components/commons/fileupload/clientlibs/fileupload/js/fileupload.js

We just need to overlay the js file and update the function

 

Caution:

Do not disable for all users, as it would take the functionality away from admin as well. 

Translate
Aanchal Sikka
kautuk_sahni
Level 9
Sep 18, 2023 6:17 AM UTC

@asp_corp do you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Translate
Kautuk Sahni