New Framework breaks DIRECTORY module

I upgraded freepbx, and the DIRECTORY module stops working.

The issue appears to be that in the newest framework there is a change to the DB.php file removing the getRow function.

When the directory.agi looks to retrieve the row from directory_detail it breaks (line 98) and prevents the code from functioning.

I am going to write a quick fix to this where I basically will bypass the get row with just a simple query to do the same thing, but please correct the directory module to not use the getRow function. If you want me to send you my fix when done I will do so, but again I am just going to rough code in a quick query to grab the record and bypass the class call.

Thanks

Here is the exact agi output:

<IAX2/voipms-11377>AGI Tx >> 510 Invalid or unknown command
<IAX2/voipms-11377>AGI Rx << Strict Standards: Redefining already defined constructor for class Dir in /var/lib/asterisk/agi-bin/directory.lib.php on line 33
<IAX2/voipms-11377>AGI Tx >> 510 Invalid or unknown command
<IAX2/voipms-11377>AGI Rx << GET VARIABLE AMPDBENGINE
<IAX2/voipms-11377>AGI Tx >> 200 result=1 (mysql)
<IAX2/voipms-11377>AGI Rx << GET VARIABLE AMPDBHOST
<IAX2/voipms-11377>AGI Tx >> 200 result=1 (localhost)
<IAX2/voipms-11377>AGI Rx << GET VARIABLE AMPDBNAME
<IAX2/voipms-11377>AGI Tx >> 200 result=1 (asterisk)
<IAX2/voipms-11377>AGI Rx << GET VARIABLE AMPDBUSER
<IAX2/voipms-11377>AGI Tx >> 200 result=1 (asteriskuser)
<IAX2/voipms-11377>AGI Rx << GET VARIABLE AMPDBPASS
<IAX2/voipms-11377>AGI Tx >> 200 result=1 (12345678)
<IAX2/voipms-11377>AGI Rx <<
<IAX2/voipms-11377>AGI Tx >> 510 Invalid or unknown command
<IAX2/voipms-11377>AGI Rx << Fatal error: Call to undefined method DB_Error::getRow() in /var/lib/asterisk/agi-bin/directory.lib.php on line 98

I checked my PEAR settings and the files exist… I am not sure why this is throwing that error…

OK, so the issue is in the PHPAGI, not returning the variables properly for $ret=$this->agi->get_variable($var);

When that is ran it is not parsing correctly the variables even though they are there.

I replaced the following with my hardcoded variables until phpagi.php corrects this issue.

function __construct_db(){
require_once(“DB.php”);
$dsn=array(
//‘phptype’ => $this->agi_get_var(‘AMPDBENGINE’),
// ‘hostspec’ => $this->agi_get_var(‘AMPDBHOST’),
// ‘database’ => $this->agi_get_var(‘AMPDBNAME’),
// ‘username’ => $this->agi_get_var(‘AMPDBUSER’),
// ‘password’ => $this->agi_get_var(‘AMPDBPASS’),

'phptype'  => "mysql",
		'hostspec' => "localhost",
		'database' => "asterisk",
		'username' => "asteriskuser",
		'password' => "1234567",
	);

	$db=DB::connect($dsn);
	return $db;
}

FYI The code I hardcoded is in directory.lib.php

OK, it’s fixed.

You were correct it was not the getVariable command. It was in my php config I was using

error_reporting(E_ALL & ~E_DEPRECATED);

The directory.lib.php file through an error stating “Strict Standards: Redefining already defined constructor for class Dir in /var/lib/asterisk/agi-bin/directory.lib.php on line 33”

this error was adding onto the output buffer so the parser couldn’t parse properly.

I changed in my php.ini error_reporting(E_ALL & ~E_STRICT & ~E_DEPRECATED) Adding STRICT, and that resolved the error as the strict warning no longer made it to the output buffer breaking the parser.

Hope this helps anyone else who is experiencing the same issue.