Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

URL with "#" in the end are not getting saved in the dialog, when I close the dialog and open again.

Avatar

Level 2

Hello,

We have a plugin in the Richtext Editor of few components. When we select a word in the Richtext field and click on this plugin, it opens up as a mini dialog, which has 5 fields and 2 buttons to submit.
There is a textfield , in which we provide the URL, now the issue is :
If we provide any URL which has a tag value (for example : www.xyz,com/perk#Anchor) , and save the dialog, and again if I reopen the dialog, the URL value is not saved in the field.


adi411_0-1689591633840.png
Fig 1. Richtext field with the Plugin (circled in Red)

adi411_1-1689591836014.png

Fig 2. The URL text field which is having issue (highlighted in red)
This issue is only occurring if I give any #tag value in the URL.

Update 1: After few debugging, I can see few console errors (screenshot attached below)

adi411_1-1689615490967.png


@kautuk_sahni  @arunpatidar 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Actually, I put the reference of the anchor plugin to check how that pathbrowser is implemented because your requirement will full-filled by that. If pathbrowser is not working with simple integration you need to cross-check with the anchor plugin.

Hope you will find your solution.

View solution in original post

9 Replies

Avatar

Community Advisor

Hi @adi411, hash is not part Apache Sling request, it can be a reason for '#' not getting saved. 


image-20211209-060613.png

Avatar

Level 2

Hi @Mahedi_Sabuj 
Well, there are other URL fields in component dialog which accepts the URL with the "#" value, the issue persists only in the custom richtext plugin field.

Avatar

Community Advisor

Hello @adi411 ,

You are using a custom RTE plugin, where you want to save the URL into a textfield.

Instead of writing in textfield use a pathbrowser with will support # URL. This feature and demo are already available in RTE Anchor plugin.

Sady_Rifat_0-1689595002924.png

 

Avatar

Level 2

Hi @Sady_Rifat 
I tried changing the textfield to pathbrowser, I was still not able to save the url with "#" value.
The RTE anchor plugin is availble, I am aware of it, but we have to use the plugin as there are other fields in that plugin which together forms the complete URL.

Avatar

Correct answer by
Community Advisor

Actually, I put the reference of the anchor plugin to check how that pathbrowser is implemented because your requirement will full-filled by that. If pathbrowser is not working with simple integration you need to cross-check with the anchor plugin.

Hope you will find your solution.

Avatar

Community Advisor

Hi,

it should not fail for # in the url.

Do you see any console log on browser while you do the save of dialog

Avatar

Community Advisor

To fix handlebars error can you do below to check if it gets resolved?

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/quot-handlebars-compile-is...
https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/uncaught-typeerror-handleb...

can you also check what values are being saved in crx/de with url having #. It’s pretty common to use # in the url and it should save the same in crx/de

Avatar

Level 2

Hi @DPrakashRaj  
Thank you for the input, I was able to resolve the handle bar issue
but there is one console error, which I have no clue
component.on is not a method 

Screenshot attached below

adi411_0-1689678222751.png