From af50861572cd5f0cffff13e8635e35ce84fcddaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Do=CC=88bertin?= Date: Wed, 3 Apr 2019 21:31:33 +0200 Subject: [PATCH] make plugin work with shopware composer setup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jonas Dòˆbertin --- Controllers/Backend/Adminer.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Controllers/Backend/Adminer.php b/Controllers/Backend/Adminer.php index 55ae5b2..3836e0d 100644 --- a/Controllers/Backend/Adminer.php +++ b/Controllers/Backend/Adminer.php @@ -22,7 +22,11 @@ public function formAction() $baseUrl = Shopware()->Front()->Router()->assemble(['controller' => 'index']); $baseUrl = str_replace('/backend', '', $baseUrl); - $shopwarePath = Shopware()->Container()->getParameter('kernel.root_dir'); + if (mb_substr($baseUrl, -1) !== '/') { + $baseUrl .= '/'; + } + + $shopwarePath = Shopware()->Container()->getParameter('shopware.app.rootdir'); $filePath = dirname(dirname(__DIR__)); $pathToPluginFolder = str_ireplace($shopwarePath, '', $filePath);