View Issue Details

IDProjectCategoryView StatusLast Update
0004638OXID eShop (all versions)2.3. Extensions (modules, themes)public2012-12-10 13:33
Reportertjungcl Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionno change required 
Product Version4.6.5 revision 49955 
Summary0004638: extending two classes with the same class
DescriptionI have a very strange bug here:

I extend both oxarticle and oxcategory with the same class, like
    'extend' => array(
    'oxarticle' => 'mymodule/core/mltobject',
    'oxcategory' => 'mymodule/core/mltobject',
    ),

In that class is a function like
    function dummy(){ return ''; }
that works in both cases, because it only uses static or common functions from oxbase.

If I activate that module, the frontend throws a lengthy sql error that some column can not be found.

-------

Now when I copy the class to a identical second class and then extend like
    'extend' => array(
    'oxarticle' => 'mymodule/core/mltobject1',
    'oxcategory' => 'mymodule/core/mltobject2',
    ),
it works all fine!
TagsNo tags attached.
Attached Files
dummy.php (1,214 bytes)
ThemeBoth
BrowserAll
PHP Versionany
Database Versionany

Activities

dainius.bigelis

2012-10-19 08:58

reporter   ~0007643

@Developers: please check from the source code side and fix if needed.

alfonsas_cirtautas

2012-10-19 14:18

reporter   ~0007646

Well, you want an impossible thing,
in plain php you can not define 2 different dummy classes

oArticle = new dummy extends dummy_parent extends oxarticle
oCategory = new dummy extends dummy_parent extends oxcategory

alfonsas_cirtautas

2012-10-19 14:22

reporter   ~0007647

I attached some spike example file dummy.php with columns ...

alfonsas_cirtautas

2012-10-19 14:34

reporter   ~0007648

http://stackoverflow.com/questions/561729/can-the-diamond-problem-be-really-solved