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.
I get these errors when visiting admin/build/path/pathauto:
# warning: Invalid argument supplied for foreach() in /homepages/18/d93080087/htdocs/drupal6/sites/scratch.cambre.biz/modules/pathauto/pathauto_user.inc on line 103.
# warning: Invalid argument supplied for foreach() in /homepages/18/d93080087/htdocs/drupal6/sites/scratch.cambre.biz/modules/pathauto/pathauto_user.inc on line 78.
# You are using the token [user-raw] which is not valid within the scope of tokens where you are using it.
# warning: Invalid argument supplied for foreach() in /homepages/18/d93080087/htdocs/drupal6/sites/scratch.cambre.biz/modules/pathauto/pathauto.admin.inc on line 233.
# 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 [title-raw] which is not valid within the scope of tokens where you are using it.
# 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 [title-raw] which is not valid within the scope of tokens where you are using it.
# You are using the token [vocab-raw] which is not valid within the scope of tokens where you are using it.
# You are using the token [user-raw] which is not valid within the scope of tokens where you are using it.
# warning: Invalid argument supplied for foreach() in /homepages/18/d93080087/htdocs/drupal6/sites/scratch.cambre.biz/modules/pathauto/pathauto.admin.inc on line 233.
# You are using the token [user-raw] which is not valid within the scope of tokens where you are using it.
# warning: Invalid argument supplied for foreach() in /homepages/18/d93080087/htdocs/drupal6/sites/scratch.cambre.biz/modules/pathauto/pathauto.admin.inc on line 233.
Note that the bad argument errors could be related to http://drupal.org/node/277398.
Relevant software/modules:
- Drupal 6.x (July 5)
- Pathauto 2.x-dev (2008-Jun-28)
- Token 6.x-1.10
Comment | File | Size | Author |
---|---|---|---|
#21 | pathauto_user.patch | 1.19 KB | bforchhammer |
#11 | module_list.png | 219.19 KB | Aren Cambre |
#8 | pathauto_errors.png | 151.56 KB | Aren Cambre |
#5 | pathauto_error.png | 167.89 KB | greggles |
Comments
Comment #1
gregglesDid you read http://groups.drupal.org/node/6706 ?
Comment #2
Aren Cambre CreditAttribution: Aren Cambre commentedI did just now per your suggestion, and it reads: "When given the choice, you should use a -raw version of a token." So that further buttresses the idea that there is a bug somewhere.
Comment #3
gregglesThe problem is that you are using tokens which are not available for the places you are using them. In that same document it says:
Also, 6.x-2.x-dev is the unstable development version. You are probably going to be better off using 6.x-1.1 (and any subsequent 6.x-1.* releases) unless and until 6.x-2.x becomes stable and gets a stable release.
Comment #4
Aren Cambre CreditAttribution: Aren Cambre commentedMy apologies. Is this not the correct place to report issues found in the dev versions?
Comment #5
gregglesThis is the correct place, I was just making a suggestion about versions to use if you are just trying to get your site work.
However, as far as I can tell this is not an "issue found in the dev version" but a misconfiguration. The module is trying to give you advice on how to configure it properly and I am doing the same.
So, I've now attached a screenshot of a similar "error" on a site of mine that is running 6.x-2.x-dev. Note that there are two arrows I've added to the drawing - #1 shows the error message at the top of the page. #2 shows the place where the misconfiguration is located which is highlighted with the text "NOTE: This field contains potentially incorrect patterns. Problem token: user-raw"
If you feel that your site is configured properly then please provide
1) The label for the textbox which Pathauto is reporting to be in error
2) The error message (the "NOTE: ..." part)
3) The pattern which you are using in that textbox
Comment #6
Aren Cambre CreditAttribution: Aren Cambre commentedThanks. I reported this as a bug because I did not change anything in Pathauto for these errors to appear. These appeared in its default state.
Comment #7
gregglesIn that case this is needs more info because I can't repeat that behavior.
Could you capture/upload a screenshot of your entire settings page?
Comment #8
Aren Cambre CreditAttribution: Aren Cambre commentedThe only two values I remember changing are inserting a custom "Node path setting" for "Article" and "Definition" content types. They were based on the value already in "Default path pattern." I got the errors visible at top before and after I inserted them.
Note again that I am running Drupal 6.x-Dev (July 5). Not sure if that makes a difference.
Comment #9
gregglesWhich version of token module are you using?
Comment #10
Aren Cambre CreditAttribution: Aren Cambre commentedToken 6.x-1.10
Comment #11
Aren Cambre CreditAttribution: Aren Cambre commentedHere's the entire module list for the site.
Comment #12
bforchhammer CreditAttribution: bforchhammer commentedI get the same error with version 6.x-2.x-dev and Token 6.x-1.10...
The reason for the error messages seems to be that e.g. token_user.inc isn't loaded when the token_list hook is invoked in line 103 in pathauto_user.inc... for a quick fix you can just add the following lines to the end of the _pathauto_include() function in pathauto.module:
I guess that in some way the pathauto module should make sure that the token module is properly loaded when using it...
Comment #13
gregglesIf you upgrade to token 6.x-1.x-dev does that fix it?
Comment #14
bforchhammer CreditAttribution: bforchhammer commentedNo.
Comment #15
gregglesThen I'm still stuck on why this occurs for some users and not others (i.e. it doesn't occur for me).
Comment #16
ar-jan CreditAttribution: ar-jan commentedI was using PathAuto 6.x-2.x-dev successfully on my Drupal 6.2 install. I just upgraded to 6.3 and now PathAuto says:
# warning: Invalid argument supplied for foreach() in /sites/all/modules/pathauto/pathauto_user.inc on line 103.
# warning: Invalid argument supplied for foreach() in /sites/all/modules/pathauto/pathauto.admin.inc on line 233.
# warning: Invalid argument supplied for foreach() in /sites/all/modules/pathauto/pathauto.admin.inc on line 233.
# warning: Invalid argument supplied for foreach() in /sites/all/modules/pathauto/pathauto_user.inc on line 103.
# warning: Invalid argument supplied for foreach() in /sites/all/modules/pathauto/pathauto.admin.inc on line 233.
And all tokens I used now get a "You are using the token [title-raw] which is not valid within the scope of tokens where you are using it."
Also the replacement patterns are no longer explosed to PathAuto.
It does not seem to be a Token problem, I also use UploadPath and it functions properly with tokens. I use Token 6.x-1.x-dev.
This seems to be the same issue. Strange thing is it was happening to Aren on Drupal 6.2 (I assume), and for me it started only after upgrading to 6.3. Does this help anything?
Comment #17
Aren Cambre CreditAttribution: Aren Cambre commentedI was using Drupal 6.x (July 5), which was prelease 6.3. But now that 6.3 final is out, I still get the errors.
Comment #18
ar-jan CreditAttribution: ar-jan commentedWell, I was using 6.2 initial release, apparently something was changed towards Drupal 6.3. Maybe some "security fixes" are influencing something that PathAuto works? If that's not the case maybe someone could confirm that a 6.3 install can have PathAuto working without errors?
Anyway, workaround/fix in #12 is enough for me now ;)
Comment #19
Aren Cambre CreditAttribution: Aren Cambre commentedSeems like a patch is available then...
Comment #20
gregglesWell, it's not a patch.
Also, a quick review of the token.module shows that in every function Pathauto calls there is also a call to token_include.
There are enough people experiencing this that it seems like a bug, but it's not reproducible. I don't want to make a fix in Pathauto if/when the problem is really somewhere else.
Comment #21
bforchhammer CreditAttribution: bforchhammer commentedHm, you're right greggles, the real problem is a different one...
The token module doesn't seem to be used properly in pathauto_user.inc: is used the following line to get the list of tokens for contact forms and trackers:
... where it should be:
Attached is a patch (against HEAD) that should fix the problems in pathauto_user.inc.
Comment #22
gregglesThanks for digging into this issue and identifying the precise problem. I'm not sure why pathauto_user.inc calls those differently than the other pathauto_*.inc files do.
@ArjanLikesDrupal and @Aren Cambre - does this patch solve the problem for you?
Comment #23
Aren Cambre CreditAttribution: Aren Cambre commentedThe patch in #21 causes the errors described at the top to disappear.
Comment #24
ar-jan CreditAttribution: ar-jan commentedConfirming. I applied the lines manually to 2.x-dev and everything works.
I now see that the reason I did not have errors before was I had not enabled my contact form. I never noticed PathAuto's errors in between enabling the contact form and upgrading to D6.3...
Comment #25
Aren Cambre CreditAttribution: Aren Cambre commentedCan you clarify? I never enabled a contact form as far as I know.
Comment #26
ar-jan CreditAttribution: ar-jan commentedHm, I was just speculating: using Drupal 6.2 + PathAuto 6.x-2.x-dev + Token 6.x-1.x-dev, everything was working. At some point it stopped working and the change was either upgrading to 6.3 or enabling the contact form, because none of the other stuff changed. Maybe it's still the 6.3 upgrade that did it, I don't know how the code works so actually I just couldn't say, never mind my speculations ;) At least it's fixed now!
Comment #27
Aren Cambre CreditAttribution: Aren Cambre commentedI think the 6.3 upgrade is the strongest case.
Comment #28
bforchhammer CreditAttribution: bforchhammer commentedYou can reproduce the error by setting up a clean Drupal 6.3 and installing/enabling modules Token, Pathauto, Contact and Tracker. That's what I did and I didn't get an error before I enabled the Contact or Tracker module...
Comment #29
greggles@bforchammer - that works to reproduce the error for some people but not all (like, not for me). I do that pretty regularly (and just did it again) and I haven't ever seen these problems.
That said, thanks very much for providing the patch. I've committed it to 5.x-2.x, 6.x-1.x and 6.x-2.x.
Comment #30
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.