CodeIgniter Forums
Data Mapper bug - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: Data Mapper bug (/thread-55888.html)

Data Mapper bug - El Forum - 11-14-2012

[eluser]Skeleton Man[/eluser]

Every time I access one of my models that extend datamapper, I get this error:

Quote:Debug Strict (PHP 5): /application/libraries/datamapper.php line 6766 - Accessing static property My_model_name::$config as non static

Where "My_model_name" is the name of a model such as "users", "messages", etc.

Here's the section of datamapper code covering line 6766:

protected function _dmz_assign_libraries()
        static $CI;
        if ($CI || $CI =& get_instance())
            // make sure these exists to not trip __get()
            $this->load = NULL;
            $this->config = NULL;
            $this->lang = NULL;

Note that $config is defined as static, yet in the above code it's being referenced as $this->config. I have strict debugging on to catch unset variables, etc while debugging my own, and it's very frustrating having to wade through dozens of "static property as non static" errors.

I'm running Data Mapper ORM 1.8.2


Data Mapper bug - El Forum - 11-15-2012

It is fixed in this commit. You can either apply this to your version, or get the latest version of the library from bitbucket.

Data Mapper bug - El Forum - 11-15-2012

[eluser]Skeleton Man[/eluser]
Great, thanks!