Welcome Guest, Not a member yet? Register   Sign In
Call to a member function _assign_libraries() on a non-object
#1

[eluser]Isos[/eluser]
hello cummunity.
I am getting this error upon calling some model:

Fatal error: Call to a member function _assign_libraries() on a non-object in /var/www/UnderConstruction/generic-core.com/system/libraries/Loader.php on line 980


where line 980 in Loader.php exists in the function:
Code:
/**
     * Assign to Models
     *
     * Makes sure that anything loaded by the loader class (libraries, plugins, etc.)
     * will be available to models, if any exist.
     *
     * @access    private
     * @param    object
     * @return    array
     */
    function _ci_assign_to_models()
    {
        if (count($this->_ci_models) == 0)
        {
            return;
        }
    
        if ($this->_ci_is_instance())
        {
            $CI =& get_instance();
            foreach ($this->_ci_models as $model)
            {            
                $CI->$model->_assign_libraries();
            }
        }
        else
        {        
            foreach ($this->_ci_models as $model)
            {            
                $this->$model->_assign_libraries();
            }
        }
    }

I don't know actually what script to paste, it's really a normal calling of a model.

What could it be the problem? And how to fix that?

Thanks
#2

[eluser]xwero[/eluser]
Most of the times when you get underlying method errors it's due to errors in your code so if you could show the code that generates the error we would be a step further.
#3

[eluser]Seppo[/eluser]
Just guessing... Maybe your model does not extend the model class?
#4

[eluser]Isos[/eluser]
[quote author="xwero" date="1208470014"]Most of the times when you get underlying method errors it's due to errors in your code so if you could show the code that generates the error we would be a step further.[/quote]
unfortunately, it's a strange thing that I am not able even to show any obvious script!
The strange thing is that some models work and some don't but only on a certain page!
I was calling a model that extends one model, then I called the extended model instead. Both work on other pages without any errors, but I had to move my functions from the models that didn't work to others called already in the script!

I don't know what script to paste! it's just a normal loading of a model and calling objects from it!
:/
#5

[eluser]Isos[/eluser]
[quote author="Seppo" date="1208473611"]Just guessing... Maybe your model does not extend the model class?[/quote]

All my models extend Model class except for one that extends one model which of course extends Model class! And all work in other scripts.
#6

[eluser]xwero[/eluser]
are both of the models loaded on that page? Or do you use an include for the extended model?
#7

[eluser]Isos[/eluser]
I use an include for the extended model of course. I think one model, that is something else, loads one of these models (the one extended by another) and it's loaded on the same page. I think that is the reason as when trying to load a model (or an extension of it) in the controller that is loaded into an already-loaded loaded model in the same controller! I don't know! it's confusing, cuz in other controllers I load the model that loads some model which is also loaded inside the same controller ! oops that's confusing! I hope you get me!

Is there a way to use functions of other models inside a model without loading it with $this->load->model ? Maybe that could solve the problem




Theme © iAndrew 2016 - Forum software by © MyBB