adodb.inc.php error msg - and Can't Log In

FIX PROVIDED: adodb.inc.php error msg - and Can't Log In

by Scott Grogg -
Number of replies: 14

Please be advised that you can fix this issue by making this revision to the adodb.inc.php file.  The error is around line 2660 of the 4.6.4 (most recent version) of the adodb system.  Look for the following section:

Change this line:  function &GetAssoc($force_array = false $first2cols = false  TO THIS:),

function GetAssoc($force_array = false $first2cols = false ),

This change will fix the entire issue!

Scott Grogg
Warner Southern College

/**
* return whole recordset as a 2-dimensional associative array if there are more than 2 columns.
* The first column is treated as the key and is not included in the array.
* If there is only 2 columns, it will return a 1 dimensional array of key-value pairs unless
* $force_array == true.
*
* @param [force_array] has only meaning if we have 2 data columns. If false, a 1 dimensional
* array is returned, otherwise a 2 dimensional array is returned. If this sounds confusing,
* read the source.
*
* @param [first2cols] means if there are more than 2 cols, ignore the remaining cols and
* instead of returning array[col0] => array(remaining cols), return array[col0] => col1
*
* @return an associative array indexed by the first column of the array,
* or false if the data has less than 2 cols.
*/

function &GetAssoc($force_array= false $first2cols = false ),
In reply to Scott Grogg

Re: FIX PROVIDED: adodb.inc.php error msg - and Can't Log In

by Martin Dougiamas -
Piksa bilong Core developers Piksa bilong Documentation writers Piksa bilong Moodle HQ Piksa bilong Particularly helpful Moodlers Piksa bilong Plugin developers Piksa bilong Testers
Can you contact the ADOdb project and let them know?  I'll add ADOdb 4.65 to Moodle CVS.
In reply to Martin Dougiamas

Re: FIX PROVIDED: adodb.inc.php error msg - and Can't Log In

by Scott Grogg -

Martin,

I've contacted John Lim and the ADOdb project about the fix.  Hopefully, they will get it implemented quickly. 

Please note:  I've tried this fix on seven different servers with the PHP 4.4.0 upgrade and it has repaired all of them.

Scott

In reply to Scott Grogg

Re: FIX PROVIDED: adodb.inc.php error msg - and Can't Log In

by Martin Dougiamas -
Piksa bilong Core developers Piksa bilong Documentation writers Piksa bilong Moodle HQ Piksa bilong Particularly helpful Moodlers Piksa bilong Plugin developers Piksa bilong Testers
Thanks, Scott!!    approve

John Lim was quick! Can someone verify for me that ADOdb 4.65 works out of the box with Moodle on PHP 4.4.0 ? If it works fine I'll add the new ADOdb to Moodle 1.5.3 and get that out straight away.
In reply to Martin Dougiamas

Re: FIX PROVIDED: adodb.inc.php error msg - and Can't Log In

by Seth Mayo -
I just downloaded ADOdb 4.65 and it still doesn't work without the fix.  However, the fix is working great!

-Seth
In reply to Martin Dougiamas

Re: FIX PROVIDED: adodb.inc.php error msg - and Can't Log In

by Sean S -
I just upgraded a client to 1.5.2 with the latest daily build and I'm still getting this error. There seems to be a number of different solutions. Is there a definitive fix for this?

Yes the client is using powweb.
In reply to Scott Grogg

Re: FIX PROVIDED: adodb.inc.php error msg - and Can't Log In

by Rob Johnson -
Scott - The fix worked for me.  Thanks so much.

Rob
In reply to Scott Grogg

Re: FIX PROVIDED: adodb.inc.php error msg - and Can't Log In

by Stacey Heron -

All fixed.. thanks so much!!

Stacey big grin

In reply to Scott Grogg

Re: FIX PROVIDED: adodb.inc.php error msg - and Can't Log In

by Arturo Campos -

Thanks the fix also worked for us.

http://undl.edu.mx/moodle

We are also hosted at Powweb.......

Saludos!    Greetings from Ensenada, Baja, Mexico.

Arturo Campos

In reply to Scott Grogg

Re: FIX PROVIDED: adodb.inc.php error msg - and Can't Log In

by Riaan Ras -
All fixed.. thanks so much!!
Riaan Ras
In reply to Riaan Ras

Re: FIX PROVIDED: adodb.inc.php error msg - and Can't Log In

by Julian Whitehead -
That was a very scary fix, the one above did not work for me, the following did though:

function GetAssoc($force_array = false, $first2cols = false )

Rather than:

function &GetAssoc($force_array = false, $first2cols = false )

All hell broke loose when I put the comma after the closing bracket like this:

function GetAssoc($force_array = false $first2cols = false ),

All fixed now though - PHEW!

Cheers Jools
In reply to Julian Whitehead

Re: FIX PROVIDED: adodb.inc.php error msg - and Can't Log In

by James Nimmo -
Thanks Julian, that worked perfectly!

function GetAssoc($force_array = false, $first2cols = false )

In reply to Scott Grogg

Re: FIX PROVIDED: adodb.inc.php error msg - and Can't Log In

by Brian Roy -
 I d/l'd the most recent ADOdb files and unzipped, changed the formula mentioned and ftp'd to my Moodle site. I've deleted the blank lines in the other files mentioned (with a text editor). But, I get the same error messages.


===========================
Notice: Only variable references should be returned by reference in /home/bconsult/public_html/moodle/lib/adodb/adodb.inc.php on line 2749

Warning: Cannot modify header information - headers already sent by (output started at /home/bconsult/public_html/moodle/lib/adodb/adodb.inc.php:2749) in /home/bconsult/public_html/moodle/lib/setup.php on line 238

Warning: Cannot modify header information - headers already sent by (output started at /home/bconsult/public_html/moodle/lib/adodb/adodb.inc.php:2749) in /home/bconsult/public_html/moodle/lib/moodlelib.php on line 2118

Warning: Cannot modify header information - headers already sent by (output started at /home/bconsult/public_html/moodle/lib/adodb/adodb.inc.php:2749) in /home/bconsult/public_html/moodle/lib/moodlelib.php on line 2119
===============
Thanks
In reply to Scott Grogg

Re: FIX PROVIDED: adodb.inc.php error msg - and Can't Log In

by Jeff Bean -

No luck here. Our hosting provider upgraded to PHP 4.4 today and promptly broke our moodle. I read this thread attentively and did the following:

  1. Downloaded adodb 4.65
  2. Edited adodb.inc.php
    1. There was some ambiguity over which of the two GetAssoc functions to change. So I changed the first one, that didn't work, I undid the change and then changed the second one. That didn't work either.
    2. I also tried the fix Eloy mentioned to return the reference rather than the entire result array. That didn't work either.

So now I'm out of ideas. I'm a developer but am not that familiar with PHP, and I don't have any more time to mess with this today. My wife, the teacher, is unhappy that her moodle is out of commission and she can't login prepare for the new school year. Help!

Average of ratings:Useful (1)
In reply to Scott Grogg

Re: FIX PROVIDED: adodb.inc.php error msg - and Can't Log In

by Derek Gaudet -

YAY!

I was in a panic when I began preapring for a teacher's workshop where I was going to show my staff how to use Moodle to enhance their classroom work. I found this forum and yes indeed my probelm was solved.

You just have to love open source!
Thanks for the great advice.

Derek