View Issue Details

IDProjectCategoryView StatusLast Update
0006737OXID eShop (all versions)2.3. Extensions (modules, themes)public2018-01-23 11:33
Reporterlins 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version6.0.0 
Target VersionFixed in Version6.0.1 
Summary0006737: Module with namespaces not working on Windows
DescriptionModules which uses namespaces are currently not working on windows.
Steps To ReproduceE.g. install "composer require linslin/oxid6-example-module:dev-master" on a Windows machine to reproduce this bug.

[05 Dec 15:21:46.003093 2017] [exception] [type OxidEsales\Eshop\Core\Exception\SystemComponentException] [code 0] [file C:\development\webroot\test-shop\app\vendor\oxid-esales\oxideshop-ce\source\Core\UtilsObject.php] [line 222] [message EXCEPTION_SYSTEMCOMPONENT_CLASSNOTFOUND linslinexamplemodulemain]
[05 Dec 15:21:46.003093 2017] [exception] [stacktrace] #0 C:\development\webroot\test-shop\app\source\oxfunctions.php(103): OxidEsales\EshopCommunity\Core\UtilsObject->oxNew(‘linslinexamplem…’)
#1 C:\development\webroot\test-shop\app\vendor\oxid-esales\oxideshop-ce\source\Core\ShopControl.php(372): oxNew(‘linslinexamplem…’)
#2 C:\development\webroot\test-shop\app\vendor\oxid-esales\oxideshop-ce\source\Core\ShopControl.php(272): OxidEsales\EshopCommunity\Core\ShopControl->_initializeViewObject(‘linslinexamplem…’, NULL, NULL, NULL)
#3 C:\development\webroot\test-shop\app\vendor\oxid-esales\oxideshop-ce\source\Core\ShopControl.php(137): OxidEsales\EshopCommunity\Core\ShopControl->_process(‘linslinexamplem…’, NULL, NULL, NULL)
#4 C:\development\webroot\test-shop\app\vendor\oxid-esales\oxideshop-ce\source\Core\Oxid.php(26): OxidEsales\EshopCommunity\Core\ShopControl->start()
#5 C:\development\webroot\test-shop\app\source\index.php(15): OxidEsales\EshopCommunity\Core\Oxid::run()
#6 C:\development\webroot\test-shop\app\source\admin\index.php(11): require_once(‘C:\development\…’)
#7 {main}
TagsModule, Namespaces, Solution Provided
ThemeAll
BrowserAll
PHP Version7.0
MySQL Version5.6

Activities

leofonic

2017-12-05 21:06

reporter   ~0012308

In \vendor\oxid-esales\oxideshop-ce\source\Core\Module\ModuleChainsGenerator.php, basename is used in order to get the class name of old style metadata. The problem is that on windows, basename accepts both slashes and backslashes as directory separator, on linux only slashes. So the namespaced classnames are treated as directory structures on windows.
I did a quick hack to get modules running on windows, from line 238:

            if ($this->createClassExtension($parentClass, $extensionPath)) {
                //EDIT
                //namespaced
                if (strpos($extensionPath, '\\')){
                    $parentClass = $extensionPath;
                    $lastClass = $extensionPath;
                }
                //old style
                else {
                    $parentClass = basename($extensionPath);
                    $lastClass = basename($extensionPath);
                }
                //END EDIT
            }

lins

2017-12-05 21:44

reporter   ~0012309

Nice work! Are you guys going to release a hotfix version?

marco_steinhaeuser

2017-12-19 11:18

administrator   ~0012320

@lins, we only publish hotfixes as kind of workarounds for critical bugs like security issues etc. Please take a look at this article (yes, has to be updated) for getting a clue about the main release policies: https://oxidforge.org/en/getting-started#toggle-id-4

lins

2017-12-19 11:27

reporter   ~0012322

@marco_steinhaeuser, thanks for your response. So I guess this bug will not be fixed in v6.0.1?

leofonic

2018-01-17 20:28

reporter   ~0012356

PR: https://github.com/OXID-eSales/oxideshop_ce/pull/623

anton.fedurtsya

2018-01-23 10:58

manager   ~0012361

Hello guys, i have merged the pull request to b-6.x recently, so will come with the next release.