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.
Hi,
Only the token [title-raw] seems to get changed via the general settings on my setup i.e. changing space for separator character and changing all text to lower case.
Other token items I am trying to use dont get changed for instance [node-path-raw] or [menupath-raw].
I am using:-
Pathauto version 6.x-1.4
and
Token version 6.x-1.14
Am I doing something wrong config wise or could this be a bug?
Thanks
Paul
Comment | File | Size | Author |
---|---|---|---|
#120 | 881270-pathauto-path-tokens_120.patch | 5.13 KB | greggles |
#115 | 881270-pathauto-doc-cleanup.patch | 3.46 KB | Dave Reid |
#109 | 881270-pathauto-path-tokens_109.patch | 5.49 KB | greggles |
#109 | 881270-token-path-tokens_109.patch | 1.54 KB | greggles |
#105 | 881270-pathauto-path-tokens.patch | 4.67 KB | Dave Reid |
Comments
Comment #1
Dave ReidTokens that end in 'url', 'path', 'alias' or those words plus the -raw suffix will not be modified by pathauto since they are assumed to be URL aliases already.
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedHello
I have the same problem with the combination of Pathauto 1.4 + Token 1.14 + Transliteration 3.0 and Pathauto 6.x-2.0-alpha2 + Token 1.14 + Transliteration 3.0. Tested on 3 different website (one is a clean install with only these three modules, the other two have a much more complex installation ) and all have the same problem.
Default path pattern : [title-raw]
Pattern for all other paths : [menupath-raw].html
- the letters are not transformed to lower case
- separator "-" is ignored, an empty space is shown between the words
- transliteration is being ignored completely ( foreign non-english letter like all special signs and character are still written )
The 6.x-2.x-dev shows the same problem.
I disabled the module, uninstalled it, deleted it, installed version 1.3 back and everything works fine, lower case, separator is being written correctly and transliteration is also working like a charm.
Thanks, Igor
Comment #3
Dave ReidOk we're going to have to specialcase some token names that end with path-raw as the violate the naming convention enforced by pathauto.
Comment #4
rolfmeijer CreditAttribution: rolfmeijer commentedsubscribing
Comment #5
Dave ReidI've committed a fix to make sure pathauto_cleanstring() is applied to the [bookpath], [bookpath-raw], [menupath], and [menupath-raw] tokens. Those are the only ones I could find that would be affected. [termpath] and [catpath] are not affected since they already apply pathauto_cleanstring() internally.
http://drupal.org/cvs?commit=406132
http://drupal.org/cvs?commit=406134
The fix will be available whenever the -dev releases regenerate, which is always within 12 hours.
Comment #6
psmith CreditAttribution: psmith commentedMany thanks for the quick turn around.
Comment #7
plachI think this is a major bug and should be addressed asap as it breaks sites working with Pathauto 1.3.
The attached patch implements Dave's suggestion from #3.
Comment #8
Dave ReidIt's already committed to CVS on both 6.x-1.x and 6.x-2.x.
Comment #9
Dave ReidMarked #880744: latest commits makes [bookpath-raw] not get lowercase or separator as a duplicate of this issue.
Comment #10
plachAw, sorry, crossposted.
@Dave Reid:
However, what about the exceptions approach?
Comment #11
Dave ReidNote that if you are using [bookpath-raw] I would highly recommend changing it to [bookpathalias-raw].
Comment #12
plachtwo times :)
Comment #13
Dave Reid@platch: That's is the approach that was committed to CVS. You can check out the actual code I committed with the links I put up in #5.
Comment #14
plachYeah, I saw it. I was just wondering if making exceptions configurable (as I did in #7) made any sense.
Here is the patch committed in #5 for people needing it NOW :)
Comment #15
Dave ReidChanging title to help others find this issue
Comment #16
Anonymous (not verified) CreditAttribution: Anonymous commentedProblem fixed by #5 ( or #14 ) ... Thank you for the fast respond and great work.
Comment #17
steven_kropp CreditAttribution: steven_kropp commentedNot quite to sure what's going on... comments are saying the problem is fixed, but also saying it'll take twelve hours?
Is the patch (pathauto-881270-14.patch) the fix, or is it that supposed to be temporary?
Not new to Drupal, but definitely new to using patches in .inc files... not sure what to do with the patch, is there going to be a new release instead?
Comment #18
interface907 CreditAttribution: interface907 commentedI am experiencing this issue with tokens from the node hierarchy module, [fullhierarchypath], for example. Aliases are no longer being converted to lower case and spaces are not removed. Do I understand correctly that this is this the expected behavior? Is there a particular reason this changed going from 1.3 to 1.4?
Comment #19
rolfmeijer CreditAttribution: rolfmeijer commented@steven_kropp
As I understand it you can use the patch now, or wait for the next dev-release which will be released within 12 hours (which apparently is an automated process). This dev-release will include the patch.
For applying patches yourself (in case you can’t wait for the dev-release) see http://drupal.org/patch/apply.
Comment #20
Dave ReidThe development releases that include this fix have been repackaged:
6.x-2.x-dev: http://drupal.org/node/710692
6.x-1.x-dev: http://drupal.org/node/95354
Comment #21
plach@Dave Reid:
They won't solve the problem cited in #18, I am afraid.
Comment #22
Dave ReidOk I think we will need to roll back skipping any tokens with the 'path' or 'path-raw' suffix and standardize if your token uses an URL alias, you must use the 'alias' or 'alias-raw' suffix for D6. This will require changing the [node-path] names in Token.module to [node-alias]. Or we can whitelist certain tokens that use the 'path' suffix. I'm not sure how to best proceed.
We absolutely need to decide on a standard for what tokens that use 'path' and 'alias' mean. My thoughts:
node:path = internal Drupal path (e.g. node/1)
node:alias = the URL alias of the Drupal path
node:url = absolute URL of the path (since it is run through url() it is also aliased)
If you need a token that is not an actual path, alias or URL, but you need something that looks like foo/bar/ferzle/omg, what is the common token suffix that should be used? tree? parents? hierarchy? (also see #860082: BIKESHED: Token for a term or menu item's entire tree/hierarchy)
Comment #23
Dave ReidComment #24
yan CreditAttribution: yan commentedI'm still waiting for a new release. This bugs breaks the module's functionality, but I don't want to use -dev on my production site. It was said a new release would be published yesterday, but it seems that hasn't been done so far. Is this going to happen or should I go back to 6.x-1.3 (which, I think, has security issues)?
Comment #25
sadist CreditAttribution: sadist commentedsubscribe
Comment #26
Dave ReidBecause no one's bothered to help solve the larger problem at hand. For such a critical issue to everyone, there has been no response to my comment #22 at all.
The security vulnerability is if you're using the [bookpathalias], [termalias] or [catalias] tokens to display HTML output. If you're only using them to make Pathauto aliases, then you are not vulnerable.
Comment #27
jacobmn CreditAttribution: jacobmn commentedI've applied the patch which works great, except that it's not scrubbing punctuation (at least not apostrophes, like in don't or wasn't). I am using a [menupath-raw] token with one of my content types. Does this bug exist with the new 6.x-2.0 revision candidate?
Comment #28
rup3rt CreditAttribution: rup3rt commentedSubscribe
Comment #29
yan CreditAttribution: yan commentedI have the same problem with a token called [field_alias-raw] as described here:
#882166: Not 'cleaning' tokens after upgrade to 6.x-1.4
6.x-1.x-dev doesn't solve the problem so I went back to 6.x-1.3.
Comment #30
MustangGB CreditAttribution: MustangGB commentedIs there a reason pathauto_cleanstring() can't be applied to all tokens automatically?
Comment #31
Dave ReidNo because that the slash character is configurable now. For instance the default for character replacement in pathauto is to remove. If we were to run cleanstring on a [menupath] token like 'Parent menu item/Clild parent item/My node title' would end up like 'parent-menu-itemchild-parent-itemmy-node-title'. The only way forward is to solve #22.
To anyone else posting "I'm having the problem too" comments, they're not helpful at this point, so please don't. Let's focus on solutions at this point. And that requires constructive, valid input.
Comment #32
RobbM CreditAttribution: RobbM commentedSubscribe.
Comment #33
gregglesFrom talking this over with Dave Reid. I think for 6.x we should try to take steps that will be minimally disruptive and then fix it "for real" for Drupal 7.
Comment #34
gg4 CreditAttribution: gg4 commentedalso affects ['content_taxonomy']['termpath-raw']
Comment #35
greggles@_double - you mean from http://drupal.org/project/content_taxonomy ? That module would need to fix it's naming.
Comment #36
gg4 CreditAttribution: gg4 commentedYeah, but I just realized that the token is actually supplied by this patch. http://drupal.org/node/420240#comment-2703168.
It looks like it follows the same naming convention as the standard [termpath-raw]. How should I properly format the token names — [term-path-raw]?
Comment #37
Dave ReidOk, so patch against 6.x-2.x that will apply pathauto cleanstring'ing to all -path* tokens except for node-path.
Comment #38
Dave ReidComment #40
vurt CreditAttribution: vurt commented#38: 881270-pathauto-stupid-path-tokens.patch queued for re-testing.
Comment #42
FreddieK CreditAttribution: FreddieK commentedsubscribe
Comment #43
jlea9378 CreditAttribution: jlea9378 commentedsubscribing.
Comment #44
hip CreditAttribution: hip commentedSubscribing
Comment #45
czoper CreditAttribution: czoper commentedcan someone pls change the title to something like
"Pathauto bulk generating/updating doesn't work - wrong aliases are generated"
as in my opinion present title doesn't reflect the problem to someone who's searching for solution to it and we're getting duplicates
cheers
Comment #46
gregglesUpdating title to match the problem.
Comment #47
notzach CreditAttribution: notzach commentedI'm experiencing the same problem after updating.
Comment #48
Dave ReidI tried brainstorming on this more this past weekend and there's more complications. Now that we made the forward-slash a controllable character, we can't reliably use explode('/') on [-path*] tokens. For instance, if I have taxonomy terms named 'animals/pets' and a sub-term called 'cats', the termpath is going to look like 'animals/pets/cats', and will incorrectly get split inbetween 'animals/pets'. This is such a mess.
The only way to fix this is to expect all other contrib modules to have run pathauto_cleanstring() on each segment in its token generation. Which if that's the case then we don't have to process those tokens at all.
Comment #49
ceege111 CreditAttribution: ceege111 commentedSame thing here I rolled back/sideways to 1.x-dev and the problem cleared up. subscribing
Comment #50
kruser CreditAttribution: kruser commentedsubscribing.
Comment #51
pwilson CreditAttribution: pwilson commentedsubscribing.
Comment #52
fenstratsubscribe
Comment #53
kevinquillen CreditAttribution: kevinquillen commentedFor example, a Webform page with [menupath-raw].htm:
Title: Coupon
Placement: Primary Links: Homes
Result: Homes/Self%20Qualifying%20Coupon.htm
[menupath].htm:
Result: Homes/Self%20Qualifying%20Coupon.htm
Comment #54
steven_kropp CreditAttribution: steven_kropp commentedI've noticed some people have a problem with placing .dev modules on their site...
What are the risks or issues involved with that?
Are "Development" modules going to cause future problems, when I update later on down the road?
Comment #55
kevinquillen CreditAttribution: kevinquillen commentedFor me I typically just follow what Drupal report and drush say is available as a stable release. I am more comfortable doing that than throwing on .dev, unless I have read through issue queues.
Comment #56
lydiat CreditAttribution: lydiat commentedsubscribing
Comment #57
mattiasj CreditAttribution: mattiasj commentedsubscribe
Comment #58
Magnus CreditAttribution: Magnus commentedsubscribe
Comment #59
ayalon CreditAttribution: ayalon commentedThis is super critical, because using the [menupath] (very very common on all my customer drupal installations) will not be rewritten (no lower case, transliteration at all).
I had to correct all lot of aliases because I updated to 1.4. Please release a new stable version as soon as possible.
Comment #60
kevinquillen CreditAttribution: kevinquillen commentedI agree with #59. Can the changes be reverted as a minor release? Most people who upgraded because of drush or seeing stable release may not realize this, read the forums, or know to downgrade to 1.x-dev. It would be one thing if this were an obscure module, but its not.
Comment #61
jlea9378 CreditAttribution: jlea9378 commentedDoes the dev release resolve the problem? I just went back to 1.3 since 1.4 broke my setup...
Comment #62
mattiasj CreditAttribution: mattiasj commentedI tried the dev-version and it solved things for our installation (menupath-issue).
Comment #63
jlea9378 CreditAttribution: jlea9378 commentedI tried installing the dev version, but it didn't help -- I just created a page and the path didn't use the separators. The pattern is: [fullhierarchytitlepath-raw]
Comment #64
kevinquillen CreditAttribution: kevinquillen commentedThe 1.x-dev version from August 13th?
Comment #65
jrstmartin CreditAttribution: jrstmartin commentedSubscribe. I love using [save-lineage-vid-termpath-raw].
Comment #66
fleetcommand CreditAttribution: fleetcommand commentedAs for #22 and #860082: BIKESHED: Token for a term or menu item's entire tree/hierarchy, I'd drop "parents" and would prefer "hierarchy" (more) or "tree" (less) instead.
Comment #67
michal07 CreditAttribution: michal07 commentedI have had problem described first by psmith when I used Token 6.x-1.14 and Pathauto 6.x-1.4 I got for pattern [menupath-raw] this output: "úvod" was title of page and generated url was "úvod" too. But I tested Pathauto 6.x-2.x-dev and same Token version and problem is now like this: "úvod" was title of page and generated url was "vod". It looks like the problem described in title of this topic is solved, but now in devel version is another problem (in short - pattern removes [not substitutes] letters written in local language).
Comment #68
emilyf CreditAttribution: emilyf commentedthank you very much. the 6.x-1.x-dev version has resolved this for me both with menupath-raw and bookpath-raw. Much appreciated.
Comment #69
benleivian CreditAttribution: benleivian commentedThanks for the fix in 6.x-1.x-dev. A 1.5 release would be nice so I don't have to explain why a "development version" is running live.
Comment #70
Peter Arius CreditAttribution: Peter Arius commentedsubscribe
Comment #71
mdupontThe 6.x-1.x-dev version still doesn't clean some tokens : I encounter the issue with [menu-trail-parents-path-raw] as well as the non-raw version [menu-trail-parents-path], which are tokens from the Menu Trails module. They were working fine with Pathauto 6.x-1.3.
Comment #72
mariomaric CreditAttribution: mariomaric commentedSubscribe.
Comment #73
option4 CreditAttribution: option4 commentedsubscribe
Comment #74
magical drop CreditAttribution: magical drop commentedComment #75
magical drop CreditAttribution: magical drop commentedsubscribe
Comment #76
rpsusubscribe
Comment #77
Shadlington CreditAttribution: Shadlington commentedsubscribing
Comment #78
MustangGB CreditAttribution: MustangGB commentedComment #79
plachFollowing #66 the attached patches (branches 1.x and 2.x) introduce support for segment cleaning for tokens ending with "hierarchy"/"hierarchy-raw".
This is needed by #867288-5: Pathauto path generation.
Comment #81
plachComment #82
Dave ReidHonestly the best approach forward here for D7 is to *stop* using any kind of tree tokens at all. Do not allow them. Enforce use of [mything:parent:alias]/[mything:name]. I'm still at a loss on how to address properly for D6.
Comment #83
plach@Dave Reid:
I ain't sure I follow you: would the
[mything:parent:alias]
token return a string like'foo/bar/baz'
? If so it seems you are proposing to call those kind of tokens'parent'
. If not how would I get a string with a dynamic number of levels?Cannot we agree on a "hierarchy"/"parent"/"tree" suffix to trigger the segment-cleaning mode?
Comment #84
Dave ReidBecause we added making the forward slash configurable in the punctuation settings, how do we determine where the segments start and end when the segments themselves have a slash in them (for example, a term named 'cats/dogs')?
Comment #85
gg4 CreditAttribution: gg4 commentedMaybe that is a good question to ask. Which is more of a priority: having the ability to convert the forward slash or being able to use forward slash delimited segments?
::
Comment #86
Dave ReidSpent some good time today brainstorming solutions and I think it's been narrowed down to two solutions:
$options['pathauto'] = TRUE
. This has several advantages with the one downside that this will not work 100% until all modules providing a tree-style token convert to using this.Comment #87
jonathanpglick CreditAttribution: jonathanpglick commentedsubscribe
Comment #88
mattiasj CreditAttribution: mattiasj commentedI would vote for solution #1 since #2 would probably take quite some time to reach full functionality again.
Comment #89
plach@Dave Reid:
I really like solution #2, I'd make only a simple change to it: modules implementing
hook_token_values()
could return their favorite segment delimiter through the following (or similar) data structurearray('segments' => $term_tree, 'delimiter' => ':')
.That said, IMHO the right way to proceed here is roll everything back for the 6.x-1.x-dev branch, since there are lots of broken tokens out there right now, and implement #2 in the 6.x-2.x-dev and 7.x-1.x-dev branches.
Edit: Perhaps
$options['context'] = 'pathauto'
would be more general.Comment #90
MustangGB CreditAttribution: MustangGB commented/agree with plach
Comment #91
gregglesI think
$options['context'] = 'path'
is a more generic and still descriptive enough. I'm not prideful enough to think pathauto deserves it's own context ;)I could go either way on whether we make this change to the 1.x branch. I think it's up to Dave since he's doing the work. My impression is that the most popular tokens affected by this are in pathauto/token module itself and therefore we know we can fix those quickly.
Comment #92
plach@greggles:
In my mind 'context' was a generic value that could be the calling module's name or any other useful info.
A brief summary of the modules implementing tokens reported here not to be working: Token, Node Hierarchy, CCK, Content Taxonomy, Hierarchical Select, Menu Trails, Menu translation (Node).
IMO we could have a forward compatible solution in the 6.x-1.x-dev branch: i.e. the same code posted by Dave in #86 (I can't access it anymore) without the if branch that prevents the
'/(path|alias|url|url-brief)(-raw)?$/'
tokens to be cleaned. We could then "break" non compatible tokens in 6.x-2.x-dev.Comment #93
no2e CreditAttribution: no2e commentedsubscribing
Comment #94
gregglesI don't like the idea of each module defining their own context unless it's legitimate. I can only think of a few real "contexts": html, plain text, paths.
That doesn't indicate their popularity in usage on live sites. My impression is that the most commonly used tokens are in pathauto and token. CCK is probably next most popular, but even those are confusing to a lot of users. The rest are cases where the modules themselves are not that commonly used so the tokens are probably even less commonly used.
Comment #95
Dave ReidA 'paths' context doesn't really make sense to me because this is a special case that Pathauto only needs an array. Although html and plain text contexts make sense - URLs would just be 'plain text' though I think - in which case it would make more sense to use $options['html'] = TRUE just like we do elsewhere in Drupal hooks. Normally we would never *ever* want that. We can bikeshed this as well: maybe use 'path_array' => TRUE to show it's explicit that fake paths need to return an array. I'm still partial to 'pathauto' => TRUE.
I'm looking into whether this change would break backwards compatibility with 6.x-1.x, but I have a feeling it will be fairly easy to fix the major modules (we can coordinate a pathauto/token release).
Comment #96
joepilar CreditAttribution: joepilar commentedsubscribing
Comment #97
sense-designsubscribing
Comment #98
plach@Dave Reid:
No strong preference about this, it was just a notice.
I don't think this would be a great problem too, but we can always rollback the changes for the 1.x branch and give time to module maintainers to get their module working with the 2.x one.
However you decide to proceed I'd love to have the possibility to provide an array of token segments to be cleaned/glued together (as you suggested in #86) even in the 1.x branch. Also having the possibility to specify the glue string would be nice :)
Comment #99
plachAnother consideration: if use an option like
'path_array' => TRUE
or'segments' => TRUE
we won't need to make Token tokens aware of Pathauto existence. Theorically any module could exploit that option.Comment #100
echoz CreditAttribution: echoz commentedposting to subscribe -
moved to dev version to use menupath-raw, which I use to have child pages in a menu use the parent's body class of "section-xxx" in a zen based theme.
Comment #101
jpfeifer CreditAttribution: jpfeifer commentedsubscribe
Comment #102
Nitebreedsubscribing
Comment #103
jlain CreditAttribution: jlain commentedsubscribing
Comment #104
igorski CreditAttribution: igorski commentedsubscribing
Comment #105
Dave ReidAttached are the current patches for both pathauto and token to implement #86-2.
Comment #107
greggles$options was not being accepted by pathauto_token_values so I added that.
Then I got hung up on _token_array_merge which very handily navigates the token tree, looks for tokens that are an array, and squashes the array down to a single string assuming that this is an error.
We could add in logic to that function that looks to see if it's a
strpos($token, 'path') !== FALSE
token and, if so, allow it to have an array. That doesn't guarantee that it's behaving properly, however, so really we should also test!empty($options['pathauto'])
.That would fix the problem but it puts pathauto specific code into token which feels wrong.
Can we use a more generic name for the $options value now? ;)
Comment #108
Dave ReidI think what actually needs to happen is I need to revert the array-checking token merging to an actual requirements check in token.install to actually check if a token is defined twice. token.module shouldn't care *at all* about the return values of tokens. Then there's no pathauto-specific code.
Comment #109
gregglesComment #110
gregglesI could post a comment...
I think these are ready to go. They seem to solve most of the problem.
@yan in #29, your situation is weird because the text field is named "alias" so the token is "field_alias-raw" and for the pathauto module it means something important when a field is named like that. I suggest renaming it so that "alias-raw" is not at the end. Something like "field_alias_manual-raw" works fine.
Comment #112
Dave Reid#921988: Move duplicate token check to token_requirements() has been committed to token.module so should make this easier.
Comment #113
Dave Reid#109 has been committed to CVS for 6.x-2.x. Will need to be ported to 6.x-1.x. Likely it will need to be brought forward to 7.x-1.x as well, but there are currently no tokens which require this behavior.
http://drupal.org/cvs?commit=427086
Comment #114
plachGreat! A couple of minor things:
The line wrapping is over column 80.
Trailing whitespaces.
Powered by Dreditor.
Comment #115
Dave ReidFollow-up patch to cleanup and revise the inline docs.
Comment #116
plachLooks good.
Edit: I'll have a last try: what about the following?
Comment #117
gregglesThe proposal in #116 doesn't look intuitive to me.
Comment #118
plachSorry, wrong code, I meant something like:
Comment #119
andreas.glaser CreditAttribution: andreas.glaser commentedsubscribing
Comment #120
gregglesI swear I posed this already...
Here's a 6.x-1.x-dev patch including the fixes in #115.
Comment #121
plachTrailing whitespaces.
Forgive my english: is "an value" correct?
Maybe "Token"?
Powered by Dreditor.
Comment #123
Dave Reid#115 and fixes in #121 committed to 6.x-2.x.
Comment #124
gregglesAnd now 6.x-1.x as well: http://drupal.org/cvs?commit=428186
Thanks, plach!
Based on earlier comments I think this is postponed for 7.x until we have a real problem token there.
Comment #125
makangus CreditAttribution: makangus commentedI have the drupal 6 dev version and [menupath-raw] is still not getting cleaned. Is there a particular version of Tokens I need to have?
Comment #126
Dave Reid@amak:
Pathauto 6.x-2.x-dev from Sep 24th or later
Token 6.x-1.x-dev from Sep 24th or later
Comment #127
gregglesOr Pathauto 6.x-1.x-dev tarball from tomorrow or CVS today.
Comment #128
madlee CreditAttribution: madlee commentedsubscribe
Comment #129
augiem CreditAttribution: augiem commentedI'm having this bug on a live site after upgrading as well. menupath-raw.
I just tested 6.x-1.x-dev from 2010-Sep-27. It did not work.
Update: Per suggestion in #132, I also upgraded Token to the dev version and now it works.
Comment #130
echoz CreditAttribution: echoz commentedAs per comment in #126, Token 6.x-1.x-dev from Sep 24th or later makes this possible. Cleans previous issues for me.
Comment #131
mariomaric CreditAttribution: mariomaric commentedLatest 6.x-1.x-dev fixed issue that I had with
[term-raw]/[bookpath-raw]/[title-raw]
token...Comment #132
Dave Reid@augiem: Can you please re-confirm if you are using the latest 6.x-1.x-dev version of Token as well, otherwise this fix won't work.
Comment #133
augiem CreditAttribution: augiem commented@Dave Reid #132: I didn't realize I had to update Token as well. I've done that and now the menupath-raw tokens are working again. I should have read the whole thread I guess. Sorry. Thanks for the quick reply and the help!
Comment #134
allella CreditAttribution: allella commentedConfirming that Token 6.x-1.x-dev (2010-Sep-24) + Pathauto 6.x-1.x-dev (2010-Sep-27) fixed this issue for me. Using Drupal 6.19.
Pattern for all Page paths: [menupath-raw]
Comment #135
mdupontI tested with Token dev tarball (Sep 25) and Pathauto dev (Sep 28). Translitteration is on and Pathauto settings is to change aliases to lowercase.
While built-in tokens are cleaned correctly ([title-raw], [menupath-raw]), tokens set by third-party modules are not cleaned at all (for example, [menu-trail-parents-path-raw] from Menutrails module). Will every third party module exporting tokens have to update its code, unless users will get incorrect aliases containing upper-case and non-translitterated characters?
Comment #136
MustangGB CreditAttribution: MustangGB commented@mdupont
I believe this is the case, all modules that make use of pathauto require updating
Perhaps someone could summarise the API change
And give an example of how to update a module that worked fine with 6.x-1.3 to again work fine with 6.x-1.x-dev from Sep 27th or later
Comment #137
mdupontThanks Network. If modules exposing tokens that can be used by Pathauto require updating, I suggest to put a notice on Pathauto's module page.
Is this confirmed? I need to know so I can add an issue for modules that need to update their tokens.
Comment #138
seb_richards CreditAttribution: seb_richards commentedsubscribe
Comment #139
jlea9378 CreditAttribution: jlea9378 commentedI tried upgrading to the latest PathAuto 6.x-1.x-dev and Token 6.x-1.x-dev releases, but it still isn't replacing spaces and such correctly like it did in version 1.3. I'm using this for my pattern:
[fullhierarchytitlepath-raw]
This is what it did with the path:
/Student%20Resources/Clubs%20%2526%20Activities/Phi%20Theta%20Kappa/test%20test%20page
It should have put dashes where it found spaces.
I'm using the latest release of Node Hierarchy: 6.x-2.x-dev
Comment #140
Dave ReidWe need people to file issues with modules providing fake-path tokens to get them to use the new format detailed here.
Comment #141
gg4 CreditAttribution: gg4 commented@Dave Reid
Where is the most complete documentation of the new format?
::
Comment #142
Dave ReidIt's fairly simple if the token name includes the word 'path':
Before:
After:
If the token name does not include the word 'path' then the token name will need to be changed.
Comment #143
gg4 CreditAttribution: gg4 commentedThanks.
::
Comment #144
pianomansam CreditAttribution: pianomansam commentedUpgrading from 6.x-1.14 to either 6.x-1.x-dev or 6.x-2.x-dev has not resolved my issue with [menupath-raw]. The only way to resolve for me has been to downgrade to 6.x-1.13, which has the security issue. Please advise.
Comment #145
greggles@pianomansam - You must also upgrade Token to the latest dev.
Comment #146
yan CreditAttribution: yan commentedI'm still not really understanding what's going on here. Two months (!) ago there was a new release (6.x-1.4) to fix security issues. But that release broke a good part of the module's functionality, which is why many people (like me) are forced to use the insecure 6.x-1.3. Did the security fix change things that led to the breaking of the module in such simple cases like using a CCK field to create a path? If not, wouldn't it be the best to simply revert those changes to make the module work and then work on the structural changes?
Sorry, but I'm really confused. Now, this issue is even set to 7.x-1.x-dev, "normal" and "postponed" although the latest release for 6.x has critical problems.
(My case is explained in #29)
Comment #147
Dave ReidReading comprehension ftl.
The security fix was not the problem, it was a combination of bug fixes and feature requests that would have been difficult to roll back and pissed more people off. This has *already* been fixed in 6.x-1.x-dev and 6.x-2.x-dev and we're rolling new releases today.
Comment #148
xeontheone CreditAttribution: xeontheone commentedYesterday has come out the new Token module. Updating Pathauto and Token to the latest stable release has solved this problem for me.
That said, it is a shame that it has taken THREE MONTHS to sort out this issue, caused by the way by a security fix done in hurry.
It's not possible that EVERYTIME there's an upgrade to do to Drupal, something broke!
Comment #149
yan CreditAttribution: yan commentedI just tried with Pathauto 6.x-1.5 and Token 6.x-1.15 but to no avail: My problem from #29 stays the same. I use a CCK field ("alias") to create the path but
* Spaces are not converted into dashes (the separator)
* Special characters are not replaced at all (should be as defined in i18n-ascii.txt)
* "Reduce strings to letters and numbers from ASCII-96" has no effect
Going back to insecure 6.x-1.3 again.
Comment #150
yarrait CreditAttribution: yarrait commentedsubscribing
Comment #151
greggles@xeontheme - this is your first comment in the issue and all you have to say is a complaint? You also haven't contributed (in the form of code, documentation, simpletests, money, etc. as far as I can tell) to the improvement of module quality. And yet you expect me to somehow provide you with free services *and* listen to your complaints? Your karma just went down in my book. Note that the GPL comes with no warranty, but I offer a money back warranty on all my modules. If you have a bug I will fully refund the price you paid me for them.
@yan - I answered you already in http://drupal.org/node/881270#comment-3490014 - you seem to be ignoring it. If you change the status again I will see about having your account blocked for inappropriate use of the issue queue. If my explanation is insufficient for you, open a new issue.
Comment #152
yan CreditAttribution: yan commentedHi greggles, calm down please, I didn't mean to offend you or anybody else. I guess I overread your comment #110 when you posted it, sorry for that. I guess I'll have to rename then, although I don't like it very much.
Comment #153
yan CreditAttribution: yan commentedbtw, if there are names that don't work with pathauto, shouldn't there be a warning or a hint? Or did I just not see it?
Comment #154
Dave ReidI've started writing a book page at http://drupal.org/node/936068 to document the standards that Pathauto applies to token names.
Comment #155
dilari CreditAttribution: dilari commentedupdating to pathauto 1.5 and Token 1.15 solved my issues with [menupath-raw] . Thank you !
just remember to delete and regenerate your aliases.
Comment #156
erik CreditAttribution: erik commentedA Big thanks to all contributers above for working out a decent solution! (It fixed the [menupath-raw] alias issue for me..)
Comment #157
yan CreditAttribution: yan commentedThanks Dave. That means that modules shouldn't 'send' tokens that have the mentioned patterns to Pathauto, right? Now, CCK allows free naming of fields which can easily lead to a situation like mine (naming a field 'alias' or so). What would be the steps to prevent that those fields are treated as 'special' fields? Should the CCK module take care of that, i.e. for example by adding a -cck or whatever? Or would it be a task for the Token module? Or maybe a warning on the Pathauto settings page if such a pattern is detected?
Comment #158
xeontheone CreditAttribution: xeontheone commentedI posted the solution, and someone has taken advantage of it (#155).
That said, I am unsatisfied in the general way in which Drupal is carried along. Your free work is welcome.
Comment #159
erik CreditAttribution: erik commentedCan't remember seeing you contribute the solution..
I also don't understand what you mean by '...the general way in which Drupal is carried along.." ?
Comment #160
dilari CreditAttribution: dilari commented@xeontheone #158:
For the sake of clarity: could you be more specific about your dislikes ?
[EDIT] plach #161 is right:
@xeontheone: There is no need to be so cynical, there's a difference between thanking someone for his hard and dedicated work and complaining about it. So i guess, taking plach's comment in consideration, if you have any suggestion on improving things, start working on it.... in another issue.
Comment #161
plachIn another issue, please.
Comment #162
yan CreditAttribution: yan commentedI just noticed that it's not possible to change the machine readable name of a CCK field. That means I have to fix my issue directly in the database? That would leave me very unsatisfied with a production website with a couple of thousands of nodes.
Comment #163
greggles@yan - The answer is to add a new field to the node, do a database level update query, and then delete the old field.
Comment #164
xl-network CreditAttribution: xl-network commentedSubscribing
Comment #165
kevinquillen CreditAttribution: kevinquillen commentedUpgraded Pathauto 6.15 and Token to 6.15, my aliases still aren't changed to lowercase for [menupath] or [menupath-raw].
Is this something I will be able to do with the recent changes? I like to have it set as menupath so the alias looks like path_section_title/parent_page_title/child_page_title.htm.
Is there another token that could facilitate this?
Comment #166
kevinquillen CreditAttribution: kevinquillen commentedWait a second... for some reason Drupal still thinks Token 1.14 is installed, even though the files are 1.15 and I've ran update.php.. wonder what happened.
Comment #167
Dave Reid@Kevin: That usually means you have a sneaky version of Token hiding somewhere else. You can check your {system} table for the filepath of the module.
Comment #168
lubnax CreditAttribution: lubnax commentedsubscribing
Comment #169
mraichelson CreditAttribution: mraichelson commentedsubscribing
Comment #170
eloivaqueis not a solution, but i downgrade version to pathauto 1.3 and now if that works
Comment #171
David_NZ CreditAttribution: David_NZ commentedThanks for the in-depth knowledge passed on here. The karma is great just a couple of entries from those not perceptive of the work and thinking going on here.
I am new here nothing loaded yet just reading the extensive documentation.
As a newbie should I load Pathauto 6 or 7?
Comment #172
Blackstallion CreditAttribution: Blackstallion commentedI previously had pathauto 6.x-1.5 and token 6.x-1.1.5 but using [hierarchypath] token was not converting spaces to dashes. I didnt check the issues and just upgraded to 6.x-2.0 alpha3 and the problem still persists. Unlike Kevin at #165 my drupal shows the latest token yet still I can't use the [hierarchypath] token. Does [hierarchypath] tokens covered in the updates and bugfixes? or just menu-path?
From the discussion I am I think any token that ends with path keyword should work?
Comment #173
Blackstallion CreditAttribution: Blackstallion commentedMenupath token seems to be working but hierarchypath is not. Honestly speaking I never know the difference between the two :)
For previous pathauto versions I guess hierarchypath worked for me thats why I used it. Anybody knows the difference?
Comment #174
Dave Reid@Blackstallion: It needs to be fixed in the nodehierarchy module in #883604: Fully supporting and integrating PathAuto and Token.
Comment #175
Blackstallion CreditAttribution: Blackstallion commentedYes I just got the hold of the issue and finished reading the node hierarchy issue. Came here to update my post that Its a nodehierarchy issue but you were prompt and replied before me. My apologies, I should research more before posting, Probably the reason why I don't post in issues. Great work Dave!
Regards
Comment #176
Lukas von Blareris there a way to regenerate all aliases in 6.x preserving the old ones?
Comment #177
sadist CreditAttribution: sadist commentedif it's nodes, go to admin/content/node, select the nodes that you like to update and select Update URL alias from the select list form to update.
Comment #178
Lukas von Blarerok. what if there are about 8000 nodes?
Comment #179
gregglesIf there are hundreds or more of nodes use Views Bulk Operations.
Comment #180
sadist CreditAttribution: sadist commentedby default, I think it will list only 50 nodes? You either do this for all your 8000 nodes (160 pages) or you may create your custom page using something like VBO.
anyway, I think it's better that you create your own queue regarding your issue or post your question in the forum.
Comment #181
jelo CreditAttribution: jelo commentedHi,
I am not entirely sure if I should be posting my question here or in the token issue queue. However, this seems to be the cause for the problem I am seeing. I am fairly new to Drupal and have never build my own tokens. Could someone please clarify the impact of this discussion on custom tokens?
In the site I maintain a custom token is generated in a module. These tokens stopped working properly after the upgrade to Token 6.x-1.15 and Pathauto 6.x-1.5 (punctuation and spaces not removed, not converted to lower case etc.). Below is the code to create a limited menupath (2 levels only). The site uses the workflow module and hence needed some extra checks because workflow influenced the values that some of the functions returned.
Based on Dave's comment in 142, is it enough to just replace
with
or do I need to run something through pathauto_cleanstring() as well?
Sorry about this lengthy post, but with my limited Drupal experience I do not get the full picture of this discussion and would appreciate your help. Thank you.
Comment #182
Bartezz CreditAttribution: Bartezz commentedHad some problems with [menu-trail-parents-path-raw] as well (D6), a working patch can be found here;
http://drupal.org/node/899482
Cheers
Comment #183
lmshawl CreditAttribution: lmshawl commentedHas anyone else experienced this issue for FileField Paths while using PathAuto 6.x-1.5 and Token 6.x-1.15 (and FileField Paths version 6.x-1.4)?
I am using [menupath]. Prior to the security update for PathAuto, my FileField Paths for file attachments would look like:
"animals/cats-dogs/kitty.jpg"
Since the upgrade, a new attachment to the same node is created in a new folder called:
"animals/cats and dogs/kitty.jpg"
Most Pathauto cleanup settings seem to be ignored.
- The letters ARE transformed to lower case
- Separator "-" is ignored, an empty space is shown between the words
- Special characters are not being stripped out as they previously were
This issue started occurring after we upgraded PathAuto to version 6.x-1.5 in late October '10. I assume we jumped right from 6.x-1.3 to 1.5.
We do use Menu Trails on our site, but I wasn't sure if this mattered being we are using [menupath] and not the custom tokens from the Menu Trails module?
Any help or insight is appreciated.