Disable or Remove "Replace" button on Name Conflict pop-up | Community
Skip to main content
Level 3
August 16, 2023

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

  • August 16, 2023
  • 3 replies
  • 1759 views

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.

3 replies

Adilos-Cantuerk
Community Advisor
Community Advisor
August 21, 2023

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.

ASP_CorpAuthor
Level 3
August 21, 2023

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.

Adilos-Cantuerk
Community Advisor
Community Advisor
August 22, 2023

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. 

 

aanchal-sikka
Community Advisor
Community Advisor
September 7, 2023

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. 

Aanchal Sikka
kautuk_sahni
Community Manager
Community Manager
September 18, 2023

@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.

Kautuk Sahni