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?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sun-fire’s picture

UPD:

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.

emclaughlin’s picture

So, 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.

chadedge’s picture

Title: Single quote breaks an alias » Single quote breaks an alias (strip html)
Issue summary: View changes
FileSize
483 bytes

I 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) --

chadedge’s picture

Version: 7.x-1.1 » 7.x-1.x-dev
Status: Active » Needs review
FileSize
482 bytes
chadedge’s picture

Status: Needs review » Needs work

The last submitted patch, 4: pathauto-fix-htmlchars-1626990-3.patch, failed testing.

chadedge’s picture

FileSize
464 bytes

Attempting to resubmit patch using more updated branch of 7.x-1.x pathauto.

chadedge’s picture

Version: 7.x-1.x-dev » 7.x-1.1
Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 7: pathauto-fix-htmlchars-1626990-7.patch, failed testing.

zestagio’s picture

Status: Needs work » Needs review
FileSize
852 bytes

I 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.

Status: Needs review » Needs work

The last submitted patch, 10: pathauto-single_quote_breaks_an_alias-1626990-10-D7.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

zestagio’s picture

Status: Needs review » Needs work

The last submitted patch, 12: pathauto-single_quote_breaks_an_alias-1626990-12-D7.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

zestagio’s picture

Status: Needs work » Needs review