View Issue Details

IDProjectCategoryView StatusLast Update
0006547OXID eShop (all versions)2.3. Extensions (modules, themes)public2016-12-14 09:51
Reporterdmitrijus.druteika Assigned To 
Status resolvedResolutionfixed 
Product Version6.0.0-beta.1 
Fixed in Version6.0.0-beta.2 
Summary0006547: Classes in module extend chain does not know instance of their real parent
DescriptionIt's about classes defined in "extend" section of a module.
Objects of such classes no longer "know" their real parent class.
As a consequence, when checking such object using "instanceof" or if defining method parameter type as real parent and passing such object, we get failure or PHP Fatal error!
Steps To ReproduceFor example, "myModule" has a class myModuleOxUser which is defined in metadata "extend" section as child of core class oxUser.

When a method if defined as following:
myMethod(oxUser $oUser)
That is already a FATAL ERROR when calling it!

When somewhere checking:
if ($oUser instanceof oxUser)
It returns false! So user is NOT user!!!

So myModuleOxUser became NOT a child of oxUser in v6 and that is a bug!
Additional Information1. Why important?
Because core methods as, for example, "getUser" can return either oxUser or null or false, or even some other instance, when a lot of different 3rd party modules run in the project.
So, for stable implementation of modules, we must check instance.

2. Whey checking real parent e.g. oxUser is needed and not myModuleOxUser directly?
Same reason - a lot of modules exist in project and extend same classes.
So we never know, which module child is last in a chain.

3. Why critical to fix?
It is not only backward compatibility issues - this is total failure of "extend" feature of the eShop.
This bug makes modules on eShop v6 less stable!
If not fixed, it is a big step backwards for quality of extensions.
TagsNo tags attached.
ThemeNot defined
BrowserNot defined
PHP Version5.6
Database VersionNot defined


related to 0006558 resolvedsaulius.stasiukaitis Unable to access directly controllers, which are defined in module "extend" section 


There are no notes attached to this issue.