Closed (fixed)
Project:
Pathauto
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
13 Jun 2018 at 18:40 UTC
Updated:
11 May 2020 at 21:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
arakwarHere's the patch.
Comment #3
idebr commentedComment #4
duaelfrThe patch applies cleanly, is simple and fixes the issue. Thanks!
There is just a nitpick that could be fixed on commit (new line with leading spaces).
Comment #5
berdirHm, is there possibly a use case that would be affected by changing this? Would be nice to have explicit test coverage for this somehow, so that it is clear why the order is like this in case someone tries to change it.
Comment #6
arakwar@Berdir
While having "Transliterate prior to creating alias" active, put a ® in a node title and use the node title in your pattern then process the pattern.
This option is used to remove à,è,é and others from URL and replace them by US-ASCII characters, but it also get the "Registered" sign in it.
I'll try to figure out how to adjust test for this, you're right, it need to be tested in case someone changes it.
Comment #7
amateescu commentedSounds like this is NW then :)
Comment #8
duaelfrI've found a new use case.
Some special characters are transliterated into other special characters. For example, strange quotes from Word are transliterated into common quotes. The thing is that if we have configured quotes to be replaced in the punctuation settings, these converted quotes won't be replaced.
Here is a specific example given we have added "®" to the punctuation list to remove it from the alias:
Test ® with “strange quotes”test-with-strange-quotestest-r-with-strange-quotestest-(r)-with-"strange-quotes"The problem comes from the transliteration that sometimes replace special characters by other special characters.
The only way I see to prevent this to happen would be to clean punctuation before AND after the transliteration process.
Comment #9
duaelfrI tried to expand the test coverage to illustrate the issue and the fix as told in the previous comment.
Comment #10
duaelfrI uploaded twice the test only patch...
This one is the good one.
Comment #13
berdirThe double replace is a bit unfortunate but not a real performance issue, thanks for the tests. Resolved a simple conflict on commit.