Developer forum

Forum » Ecommerce - Standard features » Friendly URL problem with double quote

Friendly URL problem with double quote

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Guys,

We have a problem with rendering friendly URLs for products containing double quote (") in name.

Here is an example:

http://yolanda.dw-demo.com/search-results?q=OPTMCL58RMB

This product's name is : LED, M/C 2.5” Red with Weathertight

The rendered URL is: http://yolanda.dw-demo.com/search-results/products/lighting-and-safety-prod/accessories-reflectors/accessories-miscellaneous/led-m-c-2-5

Notice how it ends just before the double quote.

We are running 9.3.7

Thank you,
Adrian


Replies

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

Any idea on this?

Any way I can solve it without a hotfix?

Thanks,

Adrian

 
Nicolai Pedersen
Reply

The url it self is correct: https://yolanda.dw-demo.com/search-results/products/lighting-and-safety-prod/accessories-reflectors/accessories-miscellaneous/led-m-c-2-5%22-red-with-weathertight

So just URL encode your attribute value, and you are home free.

BR Nicolai

 
Nicolai Pedersen
Reply

It is, byt the way, not a bug in DW.

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

I am not sure I understand.

You say that I need to URL encode a tag rendered by DW?

Shouldn't this be handled by the code that generates the link?

I don't remember having to do this in any of our past projects.

If that's the rule, I can adjust to it although it does not seem right.

Thanks,

Adrian

 
Nicolai Pedersen
Reply

Hi Adrian

Dynamicweb does not URL encode links by it self - Dynamicweb should only do that if it renderes the url inside markup - i.e. you have a tag with "<a href="{url}>" the {url} part should be url encoded.

BR Nicolai

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai, 

I am not sure how am I supposed to encode it.

The friendly URL is rendered on page load.

I am using GetString("Ecom:Product.LinkGroup.Clean") tag to render the link.

I get this value: https://yolanda.dw-demo.com/Default.aspx?ID=28&GroupID=L3-400-2-14&ProductID=MTLLB1225R

And if I enclose the link in single quotes, it will never get "friendly".

How do you think I should approach this?

Thank you,
Adrian

 

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

I believe I have spotted the problem.

The double quotes used in ProductName in the example above are not regular double quotes. I suspect they are "Word" like double quotes. instead of "

I have noticed that regular double quotes are removed already from the Friendly URL.

Not sure if you consider this type of quotes worthy of being included in your rules for stripping out characters. We'll probably have to figure out on our own a way to get rid of them for now since URLEncoding is not an option

Thank you,
Adrian

 

 
Nicolai Pedersen
Reply

Looked into this further. It is related to the character you use - another (not that common) version of the double quote. It should be replaced in the url, but does not.

TFS#45865 will fix this in 9.3.*+ from next hotfix.

BR Nicolai

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Thank you. I have reached the same conclusion.

It's a very uncommon character but it is still possible to get occurences of it.

Thank you,

Adrian

 

You must be logged in to post in the forum