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

[eluser]ovulator[/eluser]
I recently upgraded my 2.x app to the RC of 3.0. Everything is running pretty much fine on my local machine (except for some session issues).

But when I throw it up on a remote server when I try to call:

Code:
$this -> cart -> contents();

I get this error:
Code:
PHP Fatal error:  Call to a member function contents() on a non-object in ...

The app also won't cache anything in the cache folder on the remote machine, even though it cache's them just fine on the local machine.

Any insight as to what might be causing this behavior, it seems like autoload isn't working properly, but everything else seems to be working just fine and I know autoload is being called if I throw a var_dump() at the end of the file.
#2

[eluser]ovulator[/eluser]
Well I discovered that the cache issue is because the web 'user' didn't have permission to write to the cache folder, so that is fixed. The cart issue still has me stumped though.

If I
Code:
var_dump($this->cart)
on my local machine I get the expected cart object returned, but the same returns
Code:
NULL
when run on my remote server.

I also have a extension class for cart, which is just this:

Code:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Cart extends CI_Cart
{
    function __construct()
    {
        parent::__construct();
        $this->product_name_rules = '\d\D';
  $this->product_id_rules = '\d\D';
    }
}

If I delete the MY_Cart.php file (above code) from my libraries folder I will get the same
Code:
Call to member function contents() on a non-object
that I do on my remote server. Why would removing my own cart extension cause the cart object to cease to exist?
#3

[eluser]ovulator[/eluser]
Some more information.

My class is called Cart, and if i rename it to anything else, this works on the remote machine. Codeigniter should avoid this conflict, no? And why would this only be the case on my remote machine?




Theme © iAndrew 2016 - Forum software by © MyBB