First of all there are syntax errors in both of the contrib modules (even, i18n) - the if patterns start with : instead of { but end with } instead of endif;

The after installing i got a missed function error regarding some toke function i could not remember. After complete deinstalling of the pathauto module this was gone. Now when i go to the settings page i get a few errors which get even more when trying to update the settings:

* warning: Invalid argument supplied for foreach() in /.../modules/pathauto/pathauto_user.inc on line 63.
* warning: Invalid argument supplied for foreach() in /.../modules/pathauto/pathauto_user.inc on line 16.
* warning: Invalid argument supplied for foreach() in /.../modules/pathauto/pathauto.module on line 194.
* warning: Invalid argument supplied for foreach() in /.../modules/pathauto/pathauto.module on line 194.
* warning: Invalid argument supplied for foreach() in /.../modules/pathauto/pathauto_user.inc on line 63.
* warning: Invalid argument supplied for foreach() in /.../modules/pathauto/pathauto_user.inc on line 16.
* warning: Invalid argument supplied for foreach() in /.../modules/pathauto/pathauto.module on line 194.
* warning: Invalid argument supplied for foreach() in /.../modules/pathauto/pathauto.module on line 194.

(i just removed parts of the path and substituted it with...)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

greggles’s picture

Thanks for testing the 5.x-2 version of pathauto which is not stable, but does need help testing.

I committed those contrib files without much testing (as you can see) so I will need to fix them soon.

Can you provide the fix to the syntax problem you found as a patch? http://drupal.org/patch/create

fhelmschrott’s picture

note that the second (bigger) problem doesn't have to do with the contrib files. Will try my best with the patch but as i didn't do it before it would surely take some time. Probably it would be better if you fix the two lines yourself.

greggles’s picture

Title: Syntax error in contrib modules and fatal error after installation » Syntax error in contrib modules
Status: Active » Fixed

Ok, I fixed those typos. It's a great practice to create/submit patches for issues when you know the solution. It doesn't take much more time and is very helpful to other users.

I'm unable to repeat the problem that you mentioned on the settings page. Can you try uninstalling pathauto (from admin/build/modules/uninstall ) and then reinstall it and see if it works? Is that what you already did? If so can you try installing it on a second (test) site to see if the problem still occurs?

Thanks.

fhelmschrott’s picture

uninstalling and reinstalling was what i already did and didn't bring up any changes. I'll try to install another D5-instance today and install it there once more. Will report later.

greggles’s picture

Status: Fixed » Active

fhelmschrott - in irc today dldedge confirmed this issue, so I must be missing something. I'll do a clean/install checkout myself to confirm this.

Thanks.

fhelmschrott’s picture

Title: Syntax error in contrib modules » Syntax error in contrib modules and fatal error after installation

i just also did a clean install. The problem seems to be within / in the use of the tokens. function token_get_list() seems to return inappropiate values sometimes.

in pathauto_users e.g. the array $patterns which is filled by the function doesn't contain an array 'user'. Also token_get_list('taxonomy'); and token_get_list('node'); return the same content. unfortunately i'm not the big coder so i couldn't find the problem myself but hopefully my findings will help you.

fhelmschrott’s picture

FileSize
966 bytes

I did my first diff try today and built the 2 patches for the contrib modules. please doublecheck them. Next time i'll try cvsdiff then.

fhelmschrott’s picture

FileSize
714 bytes

looks like i cannot attach archives so another post required for the second one.

greggles’s picture

Well, I just did some testing and still cannot get the "invalid argument supplied foreach" problem, so I'm really confused. I'll try one more time tonight.

I already patched the two inc files in contrib, though I appreciate you providing the patch. In general they look fine.

greggles’s picture

I think I got it!!!

Ok, to use Pathauto 5.x-2 you need to use the latest code in token module . I'm doing that, but I imagine that you are using Token 5.x-1.6. That won't work :(

Can you try again with a checkout of the Token module from cvs?

You can get the code with this command:

cvs -d :pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib co -r DRUPAL-5 contributions/modules/token

greggles’s picture

In a couple minutes there will be a new official release of token at http://drupal.org/node/140568

When that node is publicly available you'll be able to get the right file directly yourselves and it should work :)

Let me know if you still have problems after that.

Thanks.

fhelmschrott’s picture

unfortunately this doesn't change anything. i completely uninstalled pathauto and token and reinstalled both (token first). I stillt get the same errors:

* warning: Invalid argument supplied for foreach() in /net/web/_local/ss/htdocs/modules/pathauto/pathauto_user.inc on line 63.
* warning: Invalid argument supplied for foreach() in /net/web/_local/ss/htdocs/modules/pathauto/pathauto_user.inc on line 16.
* warning: Invalid argument supplied for foreach() in /net/web/_local/ss/htdocs/modules/pathauto/pathauto.module on line 194.
* warning: Invalid argument supplied for foreach() in /net/web/_local/ss/htdocs/modules/pathauto/pathauto.module on line 194.

yettyn’s picture

Hi,

the problem seam to still be there, got this above General Settings when clicking Pathauto in siteconfiguration


* warning: Invalid argument supplied for foreach() in /var/www/.../drupal/sites/all/modules/pathauto/pathauto_user.inc on line 16.
* warning: Invalid argument supplied for foreach() in /var/www/.../drupal/sites/all/modules/pathauto/pathauto.module on line 194.

using pathauto 5.x-2.x-dev dated 20 march and token 1 May release.

Y

yettyn’s picture

correction, pathauto is the latest of course as I downloaded it today :-) 20 march was just the initial release.

fhelmschrott’s picture

the errors still appear but it seems to work now. I just did some testing and it saves the values. The errors seem to come from the description part where the single fields get described beneath each of the forms.

btw: pathauto makes '039' out of a single quote '. is this intentionally or can it be changed?

greggles’s picture

Title: Syntax error in contrib modules and fatal error after installation » include the includes so that more functions can be called directly
Project: Pathauto » Token
Version: 5.x-2.x-dev » 5.x-1.7
Status: Active » Needs review
FileSize
2.36 KB

Ok, now I really think I've got it...

I don't know why it was working OK for me for a while, but I finally was able to reproduce the bug and figured out that it's because pathauto calls token_get_list directly which doesn't include the token_user.inc, for example.

Here is a patch which will include the necessary files in either theme_token_help or token_get_list - whichever is called. I separated out the include code into a separate function so that I'm not pulling the old "copy past antipattern" ;)

Testing and reviews welcome.

yettyn’s picture

Applied your patch and now I get:


    * warning: Invalid argument supplied for foreach() in /var/www/www.astrocalc.com/drupal/sites/all/modules/pathauto/pathauto_user.inc on line 39.
    * warning: Invalid argument supplied for foreach() in /var/www/www.astrocalc.com/drupal/sites/all/modules/pathauto/pathauto_user.inc on line 63.
    * warning: Invalid argument supplied for foreach() in /var/www/www.astrocalc.com/drupal/sites/all/modules/pathauto/pathauto_user.inc on line 16.
    * warning: Invalid argument supplied for foreach() in /var/www/www.astrocalc.com/drupal/sites/all/modules/pathauto/pathauto.module on line 194.
    * warning: Invalid argument supplied for foreach() in /var/www/www.astrocalc.com/drupal/sites/all/modules/pathauto/pathauto.module on line 194.
    * warning: Invalid argument supplied for foreach() in /var/www/www.astrocalc.com/drupal/sites/all/modules/pathauto/pathauto.module on line 194.

maybe something needs to be done in pathauto as well? I'm no php pro so can't really tell.

greggles’s picture

Maybe I'm crazy - but the other night I had a similar problem on a test site where I was running postgresql. Is anyone who gets these errors running postgres? As I said, it could have just been a really confused installation on my part...

yettyn’s picture

mysql 4.1.22, sorry ;-)

fhelmschrott’s picture

just wanted to let you know it seems to work after applying the patch. Great work - thanks ;)

David N’s picture

I'm getting the same errors as post #13, on lines 16 and 194. Using current Token (May 1) and Pathauto releases.

greggles’s picture

Status: Needs review » Fixed

I had a small problem with the patch, but I committed this to help people test pathauto5.x-2.

Once the tarball gets rerolled it should be working reasonably well.

Christefano-oldaccount’s picture

Is this issue really closed? I'm having the same errors with token with this patch listed at #16 with pathauto 2-dev.

greggles’s picture

@christefano - currently this is only checked into the 5.x-dev version of Token. Did you get your token tarball from http://drupal.org/node/143907 ?

fhelmschrott’s picture

just to let you know - the latest dev-version of token still doesn't include that patch. i still got the errors installing from the latest dev-version. After applying the token_include.patch everything's working fine.

Anonymous’s picture

Status: Fixed » Closed (fixed)