URL with "#" in the end are not getting saved in the dialog, when I close the dialog and open again. | Community
Skip to main content
Level 2
July 17, 2023
Solved

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

  • July 17, 2023
  • 3 replies
  • 1391 views

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.



Fig 1. Richtext field with the Plugin (circled in Red)

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)


@kautuk_sahni  @arunpatidar 

 

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

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.

3 replies

Mahedi_Sabuj
Community Advisor
Community Advisor
July 17, 2023

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


Mahedi Sabuj
adi411Author
Level 2
July 17, 2023

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.

Sady_Rifat
Community Advisor
Community Advisor
July 17, 2023

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.

 

adi411Author
Level 2
July 17, 2023

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.

Sady_Rifat
Community Advisor
Sady_RifatCommunity AdvisorAccepted solution
Community Advisor
July 17, 2023

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.

DPrakashRaj
Community Advisor
Community Advisor
July 17, 2023

Hi,

it should not fail for # in the url.

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

adi411Author
Level 2
July 17, 2023

Hi @dprakashraj  
I see the below console errors

 

DPrakashRaj
Community Advisor
Community Advisor
July 17, 2023

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-not-a-function-quot-reported-after/td-p/385609
https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/uncaught-typeerror-handlebars-compile-is-not-a-function-aem-6-5/m-p/308256

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