View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0006547||OXID eShop (all versions)||2.3. Extensions (modules, themes)||public||2016-11-24 09:11||2016-12-14 09:51|
|Target Version||Fixed in Version||6.0.0-beta.2|
|Summary||0006547: Classes in module extend chain does not know instance of their real parent|
|Description||It'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 Reproduce||For 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:
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 Information||1. 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.
|Tags||No tags attached.|
|Database Version||Not defined|