View Issue Details

IDProjectCategoryView StatusLast Update
0006557OXID eShop (all versions)2.3. Extensions (modules, themes)public2016-12-09 09:59
Reporterdmitrijus.druteika 
PriorityurgentSeverityblockReproducibilityalways
Status resolvedResolutionfixed 
Product Version6.0.0-beta.1 
Target VersionFixed in Version6.0.0-beta.2 
Summary0006557: Namespaces conflict of "Payment" model VS controller in modules "extend" classes
DescriptionWhen a module overloads "Payment" controller using metadata "extend" section, and this controller is called in any way, there is a fatal PHP error:
"Fatal error: Cannot redeclare class OxidEsales\EshopCommunity\Application\Model\Payment in /var/www/oxideshop/source/Application/Model/payment.php on line 0"

NOTE: Error refers to model, but is triggered by controller call.
NOTE: In path /var/www/oxideshop/source/Application/Model/payment.php - file name is lowercase - as for controller, but rest of path is model.

IMPORTANT NOTE: Please also check other classes where model and controller names without namespaces are the same!
Steps To ReproduceTwo real examples:

1. Activate Paymorrow module and go to checkout payment stem - the error is shown.
2. In Modules Generator try to create a module with "Payment" in section "Extend classes" - the error is shown.

So, as descriptions says, if there is a module which extends "Payment" controller - this error would trigger!

Sample code from metadata:
    ...
    'extend' => array(

        ...
        'payment' => 'oxps/paymorrow/controllers/oxpspaymorrowpayment',
     ...


Sample code from the extend class:
     ...
     class OxpsPaymorrowPayment extends OxpsPaymorrowPayment_parent
     {
     ...
Additional InformationWhy important?
 - Examples from "Steps To Reproduce" are parts of OXID - eFile and SDK extensions and both fails due to this error
 - Same would happen to each payment module! Because all payment module extend "Payment" controller
 - Same issue might happen to other classes where model and controller names without namespaces are the same
TagsNo tags attached.
ThemeNot defined
BrowserNot defined
PHP VersionNot defined
MySQL VersionNot defined

Relationships

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

Activities

There are no notes attached to this issue.