pinpoint problem for 'not valid within the scope of tokens' errors
| Project: | Pathauto |
| Version: | 5.x-2.0 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
After upgrading to the current 5.x-2.0 release (and reading the upgrade guide) I went ahead and changed the token settings for my node path configuration but upon submit I am still receiving a number of warnings that I am unsure whether they are important or not.
For example:
# You are using the token [title-raw] which is not valid within the scope of tokens where you are using it.
# You are using the token [author-name-raw] which is not valid within the scope of tokens where you are using it.
# You are using the token [yyyy] which is not valid within the scope of tokens where you are using it.
# You are using the token [mm] which is not valid within the scope of tokens where you are using it.
# You are using the token [dd] which is not valid within the scope of tokens where you are using it.
All five of the above token patterns are shown as available for node path settings and creating a sample type for say poll with this pattern: poll/[yyyy]/[mm]/[dd]/[title-raw] does result in the proper path.
So let's say in my case I have 8 different node types where I am using the year pattern 'yyyy'. I get 8 warnings for this pattern after submitting the pathauto settings yet when creating a test node as above, the path is created fine.
So first off I am wondering if these warnings are in error or if I am going to have trouble later. Secondly, it would be useful to have the warnings also show which node type pattern is associated with that warning.

#1
Thanks for reporting this problem.
Can you look at the top of the pathauto_node.inc file that is on your server and tell me what it says on the line that starts "// $Id:" ? I just want to confirm that you've got the right version of that file. This problem could result from that file being a slightly out of date version.
That's an interesting idea. It lets you know which area has a problem by expanding the fieldset and it lets you know which field by adding a message to it. But you are right that it doesn't say which problem affects which pattern. The text is currently "NOTE: This field contains potentially incorrect patterns." What if it said "NOTE: This field contains potentially incorrect patterns. Problem tokens: [title-raw], [yyyy]" ?
#2
I managed to update all my files save pathauto_node.inc. So that solves the problem :)
#3
@jaydub
Sorry to be a pain but I think I may be having the same problem you had, which files did you update and where did you obtain them?
Cheers
#4
@jaydub - good to hear. What do you think of my proposal for pinpointing exactly what the problem is?
@a_sawers - it's the version included with Pathauto5.x-2.0. Should be 1.29.4.20
#5
greggles, the problem persists even with the pathauto_node.inc v. 1.29.4.20. I did a clean upgrade of the module, but the problem persists.
#6
@hpn and I found that his problem was caused by not using the latest version of token.
@a_sawer - perhaps you can confirm the version of token that you are using? Also, if you want to debug this in person I'm in irc all day or available on skype (greg.knaddison)
#7
@greggles
All working, thanks for the offer though 'greggles' much appreciated.
Thanks again
Sawers
#8
Great, then all we have left is the feature request for improved error messages.
#9
And a patch...
#10
Applied to both the 5.x-2.x and trunk.
#11
Automatically closed -- issue fixed for two weeks with no activity.