Warning Errors, aMember with Moodle

Discussion in 'Integration' started by drisley, Jan 31, 2008.

  1. drisley

    drisley New Member

    Joined:
    Jan 4, 2008
    Messages:
    19
    I'm getting the following when trying to log in as other people (for testing) with my setup:

    PHP:
    WARNINGInvalid argument supplied for foreach() in line 296 of file moodle.inc.php
    WARNING
    Cannot modify header information headers already sent by (output started at /usr/www/users/pcmech2/moodle/rconfig-zend.inc.php-bin:329in line 272 of file moodle.inc.php
    WARNING
    Cannot modify header information headers already sent by (output started at /usr/www/users/pcmech2/moodle/rconfig-zend.inc.php-bin:329in line 273 of file moodle.inc.php
    WARNING
    Cannot modify header information headers already sent by (output started at /usr/www/users/pcmech2/moodle/rconfig-zend.inc.php-bin:329in line 274 of file moodle.inc.php
    WARNING
    Cannot modify header information headers already sent by (output started at /usr/www/users/pcmech2/moodle/rconfig-zend.inc.php-bin:329in line 275 of file moodle.inc.php
    WARNING
    Cannot modify header information headers already sent by (output started at /usr/www/users/pcmech2/moodle/rconfig-zend.inc.php-bin:329in line 276 of file moodle.inc.php
    WARNING
    Cannot modify header information headers already sent by (output started at /usr/www/users/pcmech2/moodle/rconfig-zend.inc.php-bin:329in line 227 of file check.inc.php
    I don't know what the problem is. I can get in fine, but others have been reporting this problem. And when I try logging in as them, sure enough, I get the same.

    Any ideas?
  2. drisley

    drisley New Member

    Joined:
    Jan 4, 2008
    Messages:
    19
    Related information: This happens when I try to log in as a member who is in aMember as PENDING. So, they have no capabilities in Moodle yet, and I think that is leading to the WARNING being generated.

    If this is a bug with the plug-in, it should be fixed because PENDING members should be able to log in and complete their payment via aMember.
  3. drisley

    drisley New Member

    Joined:
    Jan 4, 2008
    Messages:
    19
    Sorry, I may have posted too early. I had to modify moodle.inc.php in the integration plug-in so so that it tests if $moodle_courses_context is actually an array before executing the foreach() statement. After making that hack, I am able to log into aMember.

    Perhaps this is useful for somebody else.
  4. natvetorg

    natvetorg New Member

    Joined:
    Feb 16, 2008
    Messages:
    2
    could you post the code change for what you did?
  5. rfbesa

    rfbesa New Member

    Joined:
    Jun 2, 2008
    Messages:
    28
  6. charles_5

    charles_5 aMember Pro Customer

    Joined:
    Aug 29, 2006
    Messages:
    15
    Same Problem Also!

    Could Drisley or someone else who understands this issue post the fix. Thanks!

    If not guess I will be trying to figure out the code. I hope for a response though. :)
  7. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
    a common issue is where extra spaces exist at the end of one of the files. In the case of the above example, checking moodle.inc.php for extra spaces at the bottom of the file.

    If you are getting a different file name in your error, check that one as well.
  8. greyhart

    greyhart New Member

    Joined:
    Feb 11, 2009
    Messages:
    6
    That doesn't seem the be my problem. The last thing in the moodle.inc.php file is ?>

    No extra spaces.

    Full error is:

    WARNING: Invalid argument supplied for foreach() in line 296 of file moodle.inc.php
    WARNING: Cannot modify header information - headers already sent by (output started at /home6/cyberwit/public_html/amember/rconfig.inc.php(19) : eval()'d code(1) : eval()'d code:385) in line 272 of file moodle.inc.php
    WARNING: Cannot modify header information - headers already sent by (output started at /home6/cyberwit/public_html/amember/rconfig.inc.php(19) : eval()'d code(1) : eval()'d code:385) in line 273 of file moodle.inc.php
    WARNING: Cannot modify header information - headers already sent by (output started at /home6/cyberwit/public_html/amember/rconfig.inc.php(19) : eval()'d code(1) : eval()'d code:385) in line 274 of file moodle.inc.php
    WARNING: Cannot modify header information - headers already sent by (output started at /home6/cyberwit/public_html/amember/rconfig.inc.php(19) : eval()'d code(1) : eval()'d code:385) in line 275 of file moodle.inc.php
    WARNING: Cannot modify header information - headers already sent by (output started at /home6/cyberwit/public_html/amember/rconfig.inc.php(19) : eval()'d code(1) : eval()'d code:385) in line 276 of file moodle.inc.php
    WARNING: Cannot modify header information - headers already sent by (output started at /home6/cyberwit/public_html/amember/rconfig.inc.php(19) : eval()'d code(1) : eval()'d code:385) in line 54 of file new_rewrite.inc.php

    I can log on as a regular user, but this error comes up as soon as I do. I am unable to purchase any products, though the products that are already purchased seem to work fine.

    This is not a pending user. This is the user I have for testing, and is fully authorized in aMember.

    I don't know PHP, though I have been a programmer in other languages for 30 years.

    Any suggestions?
  9. greyhart

    greyhart New Member

    Joined:
    Feb 11, 2009
    Messages:
    6
    Ok, I'm not sure what was going on, but it seems that users that were already in the amember database, had problems with the login.

    I deleted my test user, and resubscribed and everything works fine.

    I now have everything with Moodle set up, and ready to go. Now to create classes.

Share This Page