View Issue Details

IDProjectCategoryView StatusLast Update
0002620OXID eShop (all versions)4.07. Source code, Testpublic2012-12-10 13:44
Status resolvedResolutionunable to reproduce 
Product Version4.4.7 revision 33396 
Target VersionFixed in Version 
Summary0002620: oxbasket overloading causes fatal error
Descriptionfrom [oxid-dev-general]:

I try to overload oxbasket in oxid CE 4.4.7. I have an empty class. As soon, as I delete my cookies (so the new class is used) I get a fatal error:

Fatal error: oxcmp_lang::init() [<a href='oxcmp-lang.init'>oxcmp-lang.init</a>]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "vdtest_oxBasket" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in /path/to/shop/views/oxcmp_lang.php on line 73
Not neccessaryly oxcmp_lang, but one or another component. I overloaded oxBasket in other modules without problems. Any hints / ideas?

Put your module inside directory, like /modules/vdtest/vdtest_oxbasket.php.
After that, modify modules array, and cleanup tmp folder contents.
this is happening because autoloader uses your vdtest_oxbasket as main class, not the module, and then serializing, it writes module, not the main class.

after searching and traying for nearly 2.5 hours and beeing close to loosing my mind i posted to the list. NOW I found the solution: I also overload oxbasketitem. If I register oxbasket AFTER oxbasketitem the error occurs. So simply registering oxbasket in the first line of System -> Modules in the backend solves the whole problem.

As happy as I am now with having a solution for this, I still do not really understand it. Each and every class is testet for having overloads when being instantiated. So why does it make any difference in wich position oxbasket is listed in the modules-section???

Funny to see that this bug still exists. I already described it in October 2009 in the German forum

That was the thread that made me try to reposition the declaration of oxbasket. I also replyed on it, because Avenger's last post is not the best advice for maybe not so experienced module-programmers. It would possibly lead to heavy problems wile updating the shop later on. Experienced Programmers than can decide on their own, wich option to use. I prefer the decleration in the first line of modules-array, wich is way less error-prone, than editing corefiles.

Did you make a bug entry as well? I couldn't find it at the bugtracker. By chance - have you got a bug number for me?
TagsNo tags attached.
PHP Versionany
Database Versionany


Linas Kukulskis

2011-08-25 16:28

reporter   ~0005114

in latest shop unabled toreproduce:
created empty module class /modules/vdtest/vdtest_oxbasket.php
cleanup tmp files and cookeies

no errors