pinpoint problem for 'not valid within the scope of tokens' errors

jaydub - November 12, 2007 - 05:11
Project:Pathauto
Version:5.x-2.0
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

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

greggles - November 12, 2007 - 11:21
Title:'not valid within the scope of tokens' errors» 'not valid within the scope of tokens' errors - pinpoint problem area, are warnings valid?

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.

Secondly, it would be useful to have the warnings also show which node type pattern is associated with that warning.

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

jaydub - November 12, 2007 - 11:38

I managed to update all my files save pathauto_node.inc. So that solves the problem :)

#3

a_sawers - November 12, 2007 - 11:51

@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

greggles - November 12, 2007 - 12:23
Title:'not valid within the scope of tokens' errors - pinpoint problem area, are warnings valid?» pinpoint problem for 'not valid within the scope of tokens' errors
Category:bug report» feature request

@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

hpn - November 12, 2007 - 12:47
Title:pinpoint problem for 'not valid within the scope of tokens' errors» 'not valid within the scope of tokens' errors - pinpoint problem area, are warnings valid?
Category:feature request» bug report

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

greggles - November 12, 2007 - 13:41
Title:'not valid within the scope of tokens' errors - pinpoint problem area, are warnings valid?» pinpoint problem for 'not valid within the scope of tokens' errors

@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

a_sawers - November 12, 2007 - 17:22
Title:pinpoint problem for 'not valid within the scope of tokens' errors» 'not valid within the scope of tokens' errors - pinpoint problem area, are warnings valid?

@greggles

All working, thanks for the offer though 'greggles' much appreciated.

Thanks again
Sawers

#8

greggles - November 12, 2007 - 17:38
Title:'not valid within the scope of tokens' errors - pinpoint problem area, are warnings valid?» pinpoint problem for 'not valid within the scope of tokens' errors

Great, then all we have left is the feature request for improved error messages.

#9

greggles - November 12, 2007 - 19:09
Category:bug report» feature request
Status:active» patch (code needs review)

And a patch...

AttachmentSize
better_warnings_191393.patch2.7 KB

#10

greggles - November 16, 2007 - 21:04
Status:patch (code needs review)» fixed

Applied to both the 5.x-2.x and trunk.

#11

Anonymous - November 30, 2007 - 21:11
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.