Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I use a node title as a part of node alias.
Current pattern is:
catalog/[node:content-type:machine-name]/[node:title]
When node title contain the single quote symbol, the alias of node build on catalog/[node:content-type:machine-name] pattern, and does not contain node title.
How to fix this bug?
Comment | File | Size | Author |
---|---|---|---|
#12 | interdiff_10-12.txt | 705 bytes | zestagio |
#12 | pathauto-single_quote_breaks_an_alias-1626990-12-D7.patch | 852 bytes | zestagio |
#7 | pathauto-fix-htmlchars-1626990-7.patch | 464 bytes | chadedge |
Comments
Comment #1
sun-fire CreditAttribution: sun-fire commentedUPD:
How to reproduce this bug: node title must have < > symbols and quote.
For example (cyrillic text):
<М'ЯТА УПАКОВКА> Роутер D-Link DIR-100 1port WAN
Transliteration return:
Router D-Link DIR-100 1port WAN
When i removed < > and ' all works as designed.
When i removed < it also works as designed
When string contain ' and > it does not working.
Comment #2
emclaughlin CreditAttribution: emclaughlin commentedSo, if I understand what you're saying correctly, when you create a node titled "МЯТА УПАКОВКА Роутер D-Link DIR-100 1port WAN" the alias that gets assigned to it is "
node/МЯТА УПАКОВКА Роутер D-Link DIR-100 1port WAN
" and when you create a node titled "<М'ЯТА УПАКОВКА> Роутер D-Link DIR-100 1port WAN" the alias that gets assigned to it is "node/
"?Or does it not get an alias assigned to it at all? I'm attempting to reproduce the problem and finding that "<М'ЯТА УПАКОВКА> Роутер D-Link DIR-100 1port WAN" doesn't get an alias assigned to it at all through pathauto.
Comment #3
chadedge CreditAttribution: chadedge commentedI was having a similar issue where users were adding <3 (emoticon for a "heart") into the title of their posts. This caused the strip_tags to eliminate the entire title string (returning an empty string) so the path auto could not generate a URL alias.
By swapping decode_entities() and strip_tags() I was able to eliminate this issue.
-- This patch is now outdated. #4 is the correct patch (trying to delete this commit) --
Comment #4
chadedge CreditAttribution: chadedge commentedComment #5
chadedge CreditAttribution: chadedge commentedComment #7
chadedge CreditAttribution: chadedge commentedAttempting to resubmit patch using more updated branch of 7.x-1.x pathauto.
Comment #8
chadedge CreditAttribution: chadedge commentedComment #10
zestagio CreditAttribution: zestagio commentedI confirm a bug. I have a term with name "<200 mm Dia Flap wheel". Alias is empty after processing string via
pathauto_cleanstring
.Patch attached.
Comment #12
zestagio CreditAttribution: zestagio commentedComment #14
zestagio CreditAttribution: zestagio commented