I've noticed this change some time in the last month. Since upgrading to 5.x-2.3 (or maybe 5.x-2.2?), the taxonomy tokens I use in some URLs have started removing all instances of "Strings to Remove," whereas before it left them in if they occurred only at the beginning or end taxonomy term.

However, enabling "Reduce strings to letters and numbers from ASCII-96" changes this behavior, allowing all "Strings to Remove" to stay when added using a taxonomy token -- specifically, [term-raw].

I'm sure this is confusing, so I'll supply some examples. First, the replacement pattern:

  • Node type: Blog entry
  • Path: blog/[term-raw]/[title-raw]

Here's how it used to behave in July (using version 5.x-2.2 or 5.x-2.1):

  • Blog term: "What's Going On" --> blog/whats_going_on/my_title
  • Blog term: "I'm on TV" --> blog/im_tv/my_title

Here's how it behaves now (using version 5.x-2.3) with ASCII-96 filtering OFF:

  • Blog term: "What's Going On" --> blog/whats_going/my_title
  • <-- CHANGE IN BEHAVIOR

  • Blog term: "I'm on TV" --> blog/im_tv/my_title

And here's how it haves with ASCII-96 formatting ON:

  • Blog term: "What's Going On" --> blog/whats_going_on/my_title
  • Blog term: "I'm on TV" --> blog/im_on_tv/my_title
  • <-- CHANGE IN BEHAVIOR

This is causing me a bit of worry, as it's changing all kinds of alias-related stuff to break.

Comments

greggles’s picture

Status: Active » Postponed (maintainer needs more info)

Thanks for the very complete report. The short answer is to downgrade to 5.x-2.2 until we can figure this out. But since 6.x uses the same code we definitely want to figure this out.

From 5.x-2.2 to 5.x-2.3 there was a fix for problems with the "remove words to ignore" feature. That is probably what is impacting the removal of the word "on".

However, I just tried to repeat the issue as you described it and here are the results I get (I'm using 5.x-2.x-dev which has only changed very slightly since 5.x-2.3).

ASCII 96 filter on:
whats-going/my-title
im-tv/my-title

ASCII 96 filter off:
whats-going/my-title
im-tv/my-title

Can anyone else confirm the behavior that Todd Nienkerk sees?

I can understand the change in the way that "What's Going On" was turned into "whats-going" but I can't confirm the issue with different behavior under ASCII-96. Also, the code to remove "words to ignore" tries to use mb_eregi_replace which, I've learned, is somewhat tempermental depending on which version of PHP you are using. You may want to look into that code and see 1) which *reg_replace is being used 2) if one of them works better for you than that other. If so...we may need to investigate that more and make it optional per site.

todd nienkerk’s picture

Downgrading to 5.x-2.2 fixes the removal of "on" in "whats_going_on," regardless of whether ASCII-96 reduction is enabled. So... hooray!

Also, another thought: Is it possible that Path Redirect could be causing this interference with 5.x-2.3? I've noticed some nasty problems -- infinite loop redirects -- when the update action supplied by Path Redirect ("Create a new alias. Redirect from old alias.") is enabled. Perhaps there's some additional nastiness that would cause a conflict with Pathauto?

Regardless of whether I'm using Path Redirect's custom update action, however, the removal strings are behaving normally using 5.x.-2.2.

greggles’s picture

There were some infinite loop problems with Path Redirect but afaik those have all been fixed - #218277: prevent endless forwarding when the redirect points to a node that represents itself

There is another issue for infinite loops, though it has no concrete steps to repeat so I'm unsure how to test/review the patch - #281521: Prevent infinite redirection loop. If you have a concrete set of steps to repeat the bug, that would be very helpful.

Note that this issue is "needs more info" and I can't reproduce it. Unless you can provide more information or someone else can reproduce it/fix it I'm going to close it in 2 weeks...

todd nienkerk’s picture

greggles: Can you reproduce the error if you have Path Redirect installed (and the update action "Create a new alias. Redirect from old alias." enabled)?

greggles’s picture

@Todd Nienkerk - it's helpful to me if we can stay on topic with one issue per problem. If you want to discuss the separate problem of infinite loops, please create a new issue (ideally with steps to consistently repeat the problem).

todd nienkerk’s picture

@greggles: I'm not talking about the infinite loop problem, though I can understand why you think that's the case. (There's been a lot of cross-talk regarding several issues that I discovered all at once.) I have contributed to the issue regarding that bug elsewhere.

In my most recent comment, I was suggesting that you try enabling Path Redirect and set the update action to "Create a new alias. Redirect from old alias." in order to replicate the problem I was having with Pathauto's ASCII-96 filtering -- i.e., the issue at hand. It may also help if you enable Global Redirect.

I say this only to give you as much information as possible to replicate the bug. The installation that exhibited the strange ASCII-96 behavior had both Path Redirect and Global Redirect installed (and with Pathauto 2.2's update action set as I described).

todd nienkerk’s picture

(For anyone following this thread, please note that the discussion of the Path Redirect infinite loop problem can be found here.)

greggles’s picture

That makes sense, thanks for clarifying. I will try to get to testing this.

greggles’s picture

Yeah, that had no impact on it for me.

@Todd - what is in your "Strings to Remove: " field?

todd nienkerk’s picture

@greggles: My "Strings to Remove" field is the module's default.

a,an,as,at,before,but,by,for,from,is,in,into,like,of,off,on,onto,per,since,than,the,this,that,to,up,via,with
todd nienkerk’s picture

I'll try again to reproduce this bug. Again, I have two taxonomy terms that contain the string "on": "What's Going On" and "I'm on TV." The "Node path setting" for this content type is: blog/[term-raw]/[title-raw].

For the purposes of this round of testing, I have disabled the Global Redirect and Path Redirect modules.

Using Pathauto 5.x-2.2

With ASCII-96 filtering OFF: "On" removed only for "I'm on TV."

  • What's Going On --> blog/whats_going_on/node_title
  • I'm on TV --> blog/im_tv/node_title --> REMOVAL of "on"

With ASCII-96 filtering ON: No instances of "on" removed.

  • What's Going On --> blog/whats_going_on/node_title
  • I'm on TV --> blog/im_on_tv/node_title

Using Pathauto 5.x-2.3

With ASCII-96 filtering OFF: ALL instances of "on" removed.

  • What's Going On --> blog/whats_going/node_title --> REMOVAL of "on"
  • I'm on TV --> blog/im_tv/node_title --> REMOVAL of "on"

With ASCII-96 filtering ON: No instances of "on" removed.

  • What's Going On --> blog/whats_going_on/node_title
  • I'm on TV --> blog/im_on_tv/node_title

Findings

Despite having disabled Global Redirect and Path Redirect, these are the same results I received when I first reported the bug.

Enabling ASCII-96 filtering results in no removal of "on" for either version of Pathauto (5.x-2.2 and 5.x-2.3). The behavior when it's disabled, however, is different for each version.

It's also worth noting that instances of "Strings to Remove" inside the node title are not removed when ASCII-96 filtering is enabled.

dave reid’s picture

This hasn't had any more traction in almost two years. Is this a problem in Drupal 6? Should this be marked as won't fix?

dave reid’s picture

Status: Postponed (maintainer needs more info) » Fixed

No response, so marking as fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.