We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6038
    • 228 Posts
    Im getting a parse error when i try to produce the users list.
    The snippet call in my page:
    [!WebLoginPE? &type=`users` !] 


    and the error:
    [tt]« MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « PHP Parse Error »

    PHP error debug
      Error: Invalid argument supplied for foreach()
      Error type/ Nr.: Warning - 2
      File: /var/www/httpdocs/assets/snippets/webloginpe/webloginpe.class.php
      Line: 1179
      Line 1179 source: foreach ($theUser as $attribute => $value) [/tt]


    Anyone any ideas? Anyone else with this problem?


    System i am on is: Modx 9.6.1 - PHP 5.2 - Apache 2 - Ubuntu 6
      • 4310
      • 2,310 Posts
      Error: Invalid argument supplied for foreach()
      In my limited experience, and in general, this usually is caused by having no data to return.
      Do you have any users set-up yet?
        • 6038
        • 228 Posts
        Quote from: bunk58 at Sep 11, 2008, 07:33 AM

        Error: Invalid argument supplied for foreach()
        In my limited experience, and in general, this usually is caused by having no data to return.
        Do you have any users set-up yet?

        Yes I do - but you got me thinking - i set up 2 of these users before installing the webloginpe snippet. So i went back and made sure there were entries in both the ’web_users_attributes’ and ’web_users_attributes_extended’ tables for all users - and that did the trick. The missing info was tripping up the snippet. Maybe a future addition to snippet? Its not a bug (i dont think) and its not really a ’feature’ either so i dont know what you would call it - a failsafe mechanism or something?? Anyway - you helped me solve my problem.
        Muchos Gracias!
          • 4310
          • 2,310 Posts
          I’ve been caught a few times with that error when developing snippets before creating the data.
          Glad it pointed you in the right direction.
            • 40024
            • 72 Posts
            @christianhanvey Hi!I have the exact same problem!I know it is an old post,but could you be more specific as to what entries you filled in "web_users_attributes_extended" tables?My "web_users_attributes" table is not empty but "web_users_attributes_extended" is,so i am thinking that your fix might work for me as well.