Mambo error: Call to undefined method mosMenu::mosDBTable()

Why the error happens

The Mambo installed by the automatic installation scripts on our servers, is not yet fully compatible with the latest version of PHP, which we use on several of our servers, and the error:

Fatal error: Call to undefined method mosMenu::mosDBTable() 
in /home/f553636/public_html/mambo/includes/core.classes.php on line XXXX

Directly after a fresh install is a sign that the server you are running is indeed using PHP 5.3.

How to correct the error

Find the file in the install directory of mambo:

includes/database.php

And edit the file on line 786, directly after the line:

var $_db = null;

Add the following code on a newline:

function mosDBTable ($table='', $keyname='id', $db='') {
if ($table) $this->_tbl = $table;
else $this->_tbl = $this->tableName();
$this->_tbl_key = $keyname;
if (is_object($db)) $this->_db = $db;
}

In conclusion

Once the modified file is uploaded back to the account, the Mambo install should now work correctly, if you are still experiencing problems after making this change, I would recommend contacting the Mambo community for support, or consult the Mambo Documentation.

  • 18 Users Found This Useful
Was this answer helpful?