Closed (works as designed)
Project:
Pathauto
Version:
7.x-1.0
Component:
Tokens
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Feb 2012 at 09:49 UTC
Updated:
17 Feb 2012 at 09:47 UTC
Hi,
Just for page types, not other content types, the alias comes out wrong, I get:
create-page
create-page-0
etc, works fine for other content types.
Am using 7.12 with php 5.2.6-1+lenny16.
Yes I have tried todays dev version.
Comments
Comment #1
stephenrobinson commentedOh yes alias is "content/[current-page:title]"
Comment #2
stephenrobinson commenteddebug on:
$path = _pathauto_set_alias($path, $existing_alias, $op);
drupal_set_message('path=
');
returns:
Comment #3
stephenrobinson commentedIssue is with token_replace() in core includes, returns this bad value.
Comment #4
stephenrobinson commented[current-page:title] does not work when creating pages, works for other content types, as it takes the title of the node/add/page, not the title of the page you are creating?
Comment #5
stephenrobinson commentedthink this has to do with token_generate:
$replacements = module_invoke_all('tokens', $type, $tokens, $data, $options);
Comment #6
stephenrobinson commentedlatest theory involves sites/all/modules/contrib/token/token.tokens.inc
Comment #7
stephenrobinson commentedfound a fix, will create issue for token module, see http://drupal.org/node/1442420.
line 648 on:
Comment #8
dave reidThe token is working as designed. The title of node/add/page is in fact "Create page."
Comment #9
stephenrobinson commentedHi,
All that means is you have to edit and save the node to get the correct alias.
It is a useful token for use with pathauto.
I guess I will patch it for my own use....
Stephen :)
Comment #10
dave reidIf you're trying to use the node title in the Pathauto pattern, why aren't you just using [node:title] instead of [current-page:title]?
Comment #11
stephenrobinson commentedAh yes, that works, was not listed on /admin/config/search/path/patterns in the section "Replacement patterns". Thanks for the info, perhaps there is a node section missing?
Comment #12
stephenrobinson commentedAh me being stupid again, have to check all the "Replacement patterns" sections, not just the bottom forum one, sorry,
S:)