0

I am facing a problem. I have got following error "Fatal error: Call to a member function loadByOption() on a non-object in /var/www/Joomla/administrator/components/com_vodes/models/config.php on line 58". I am using Joomla 3.3.3 . I have upgraded it from 1.5 to 3.3.3

function save()
    {
        // initialize variables.
        $table          = JTable::getInstance('component');
        $params         = JRequest::getVar('params', array(), 'post', 'array');
        $row            = array();
        $row['option']  = 'com_vodes';
        $row['params']  = $params;

        // load the component data for com_ajaxregister
        if (!$table->loadByOption('com_vodes')) {
            $this->setError($table->getError());
            return false;
        }

        // bind the new values
        $table->bind($row);

        // check the row.
        if (!$table->check()) {
            $this->setError($table->getError());
            return false;
        }

        // store the row.
        if (!$table->store()) {
            $this->setError($table->getError());
            return false;
        }

        return true;
    }

Please help to sought it out.
Rupzz
  • 136
  • 1
  • 3
  • 16

1 Answers1

0
 $table          = JTable::getInstance('component');

you are passing the wrong parameter in your getInstance function the getInstance function returns null which makes the $table variable a non-object because it has no value. use your component name in setting the parameter.

Break the Law
  • 217
  • 2
  • 14