umbraco / Umbraco-CMS

Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
https://umbraco.com
MIT License
4.43k stars 2.67k forks source link

RequestHandler replaces Property Aliases #17098

Open JvaNovicell opened 2 weeks ago

JvaNovicell commented 2 weeks ago

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

13.3.2

Bug summary

I added a Turkish letter for the ReqeustHandler settings to replace a special char the specific letter is "I" without dot image

Here is my settings:

"RequestHandler": { "AddTrailingSlash": true, "ConvertUrlsToAscii": "false", "EnableDefaultCharReplacements": true, "UserDefinedCharCollection": [ // Existing replacements { "Char": " ", "Replacement": "-" }, // Additional Turkish character replacements { "Char": "ç", "Replacement": "c" }, { "Char": "ğ", "Replacement": "g" }, { "Char": "ı", "Replacement": "i" }, { "Char": "I", "Replacement": "i" }, { "Char": "İ", "Replacement": "i" }, { "Char": "ö", "Replacement": "oe" }, { "Char": "ş", "Replacement": "s" }, { "Char": "ü", "Replacement": "ue" }, // Additional Spanish character replacements { "Char": "á", "Replacement": "a" }, { "Char": "é", "Replacement": "e" }, { "Char": "í", "Replacement": "i" }, { "Char": "ó", "Replacement": "o" }, { "Char": "ú", "Replacement": "u" }, { "Char": "ñ", "Replacement": "n" }, { "Char": "ç", "Replacement": "c" } ] } } }

The Url works after deploying the change the real issue here is in the DOCs or maybe the way to use these settings..

In the documentation it states that this is used for Requests, Urls etc..

Im not sure if this is the case but everytime we save a doctype it overwrites the alias for the properties with the char list which is specific for request handling.

image

Specifics

Current documentation: https://docs.umbraco.com/umbraco-cms/reference/configuration/requesthandlersettings

Code in core project: image

image

Could be related to this: https://github.com/umbraco/Umbraco-CMS/blob/c8899afed69a97062c8c550994df1cebedfc0b96/src/Umbraco.Core/Extensions/StringExtensions.cs#L1340

Steps to reproduce

Create a content node in Umbraco BackOffice with this name all uppercased: "hakkımızda".

Create a doctype with properties containing a capital "I" in the property alias foreaxmple heroImage or trackingID.

Add below requesthandler settings to app settings

"RequestHandler": { "AddTrailingSlash": true, "ConvertUrlsToAscii": "false", "EnableDefaultCharReplacements": true, "UserDefinedCharCollection": [ // Existing replacements { "Char": " ", "Replacement": "-" }, // Additional Turkish character replacements { "Char": "ç", "Replacement": "c" }, { "Char": "ğ", "Replacement": "g" }, { "Char": "ı", "Replacement": "i" }, { "Char": "I", "Replacement": "i" }, { "Char": "İ", "Replacement": "i" }, { "Char": "ö", "Replacement": "oe" }, { "Char": "ş", "Replacement": "s" }, { "Char": "ü", "Replacement": "ue" }, // Additional Spanish character replacements { "Char": "á", "Replacement": "a" }, { "Char": "é", "Replacement": "e" }, { "Char": "í", "Replacement": "i" }, { "Char": "ó", "Replacement": "o" }, { "Char": "ú", "Replacement": "u" }, { "Char": "ñ", "Replacement": "n" }, { "Char": "ç", "Replacement": "c" } ] } } }

Save the doctype and refresh - for me it replaces the property alias to "heroimage" and "trackingiD" but also fixes my url to "/hakkimizda" from "/hakk%C4%B1m%C4%B1zda"

Expected result / actual result

i would believe it should only replace the chars in the request URL and not on all properties alias for a doctype, otherwise please change the docs.

github-actions[bot] commented 2 weeks ago

Hi there @JvaNovicell!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot :robot: :slightly_smiling_face: