AEM asset drag and drop to rte pathfield | Community
Skip to main content
Shubham_borole
Community Advisor
Community Advisor
September 29, 2017

AEM asset drag and drop to rte pathfield

  • September 29, 2017
  • 2 replies
  • 4707 views

Hello,

While doing a drag and drop of an asset (pdf asset) into rte path field that contains special character like #, I see that the # is not encoded to %23 and so when I click on the link I get a 404

Below in Classic UI

For eg:

1. I drag and drop an asset "Test Book #1" into an rte pathfield. Press Ok. In browser elements I see it linked to  - /content/dam/path/Test Book #1.pdf. When I click on the link it shows a 404 (trying to go to localhost:6503/content/dam/path/Test%20Book%20#1.pdf)

2. In rte pathfield, I browse to the path and select the path of asset at '/content/dam/path/Test Book #1.pdf' . Press Ok.  In browser elements I see it linked to /content/path/Test%20Book%20%231.pdf. When I click ok th elink it opens up the pdf in browser (chrome).

In Touch UI

1. If I try to drag and drop the pdf asset to the path field it doesn't. (Doesn't add the path in pathfield at all. I drag the asset till the pathfield and when I unclick or try to drop nothing happens, pathfield is still empty )

2. If I browse to the path and select. In this case I see the same behavior as I saw in Classic UI mentioned in point 1 (the # is not encoded)

Does anyone see same issue? What can be a potential fix for this?

To check the js functionality where can I find the OOTB js for drag and drop that can be overlayed may be to try and encode the '#' (or other special characters) also?

Thanks

Shubham

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

2 replies

Shubham_borole
Community Advisor
Community Advisor
October 4, 2017

Hello All,

Does anyone see this issue or have any insights?

Regards

smacdonald2008
Level 10
October 4, 2017

"While doing a drag and drop of an asset (pdf asset) into rte path field"

Dragging a PDF into a RTE is not recommended use case for RTE.

smacdonald2008
Level 10
October 4, 2017

Or do you mean a PathField data type -- granite/ui/components/foundation/form/pathbrowser

October 12, 2017

You are basically creating an hyperlink where '#' is a valid character and so it is not getting encoded to its equivalent code.

For example:  www.abc.com/new#12

it will point to a div with id=12.

It will be better if you change # to some other character like 'no'.