verbb / cp-nav

Control Panel Nav is a Craft CMS plugin to help manage your Control Panel navigation.
MIT License
129 stars 11 forks source link

yii\base\ErrorException: Array to string conversion at install #33

Closed thaoms closed 6 years ago

thaoms commented 6 years ago

Im getting an Array to String conversion error at install. But the plugin did install correctly. Uninstall works ok.

I have two sites (2 languages). 'siteUrl' => [ 'chilliEnglish' => '//xxxxx.be', 'chilliNederlands' => '//xxxxxx.be/nl' ],

Trace:

`yii\base\ErrorException: Array to string conversion in /data/sites/web/craftstart3-chillibe/checkout/master/6076e45d17611d536412ad56f5e2eb56b317af99/vendor/verbb/cp-nav/src/models/Navigation.php:164 Stack trace:

0 /data/sites/web/craftstart3-chillibe/checkout/master/6076e45d17611d536412ad56f5e2eb56b317af99/vendor/craftcms/cms/src/web/ErrorHandler.php(84): yii\base\ErrorHandler->handleError(8, 'Array to string...', '/data/sites/web...', 164)

1 [internal function]: craft\web\ErrorHandler->handleError(8, 'Array to string...', '/data/sites/web...', 164, Array)

2 /data/sites/web/craftstart3-chillibe/checkout/master/6076e45d17611d536412ad56f5e2eb56b317af99/vendor/verbb/cp-nav/src/models/Navigation.php(164): str_replace('{siteUrl}', Array, '')

3 /data/sites/web/craftstart3-chillibe/checkout/master/6076e45d17611d536412ad56f5e2eb56b317af99/vendor/verbb/cp-nav/src/services/CpNavService.php(198): verbb\cpnav\models\Navigation->__construct()

4 /data/sites/web/craftstart3-chillibe/checkout/master/6076e45d17611d536412ad56f5e2eb56b317af99/vendor/verbb/cp-nav/src/services/CpNavService.php(161): verbb\cpnav\services\CpNavService->_prepareNavModel(Array)

5 /data/sites/web/craftstart3-chillibe/checkout/master/6076e45d17611d536412ad56f5e2eb56b317af99/vendor/verbb/cp-nav/src/services/CpNavService.php(118): verbb\cpnav\services\CpNavService->regenerateNav(1, NULL, Array)

6 /data/sites/web/craftstart3-chillibe/checkout/master/6076e45d17611d536412ad56f5e2eb56b317af99/vendor/verbb/cp-nav/src/CpNav.php(72): verbb\cpnav\services\CpNavService->setupDefaults()

7 [internal function]: verbb\cpnav\CpNav->verbb\cpnav{closure}(Object(craft\events\PluginEvent))

8 /data/sites/web/craftstart3-chillibe/checkout/master/6076e45d17611d536412ad56f5e2eb56b317af99/vendor/yiisoft/yii2/base/Event.php(221): call_user_func(Object(Closure), Object(craft\events\PluginEvent))

9 /data/sites/web/craftstart3-chillibe/checkout/master/6076e45d17611d536412ad56f5e2eb56b317af99/vendor/yiisoft/yii2/base/Component.php(565): yii\base\Event::trigger('craft\services\...', 'afterInstallPlu...', Object(craft\events\PluginEvent))

10 /data/sites/web/craftstart3-chillibe/checkout/master/6076e45d17611d536412ad56f5e2eb56b317af99/vendor/craftcms/cms/src/services/Plugins.php(480): yii\base\Component->trigger('afterInstallPlu...', Object(craft\events\PluginEvent))

11 /data/sites/web/craftstart3-chillibe/checkout/master/6076e45d17611d536412ad56f5e2eb56b317af99/vendor/craftcms/cms/src/controllers/PluginsController.php(49): craft\services\Plugins->installPlugin('cp-nav')

12 [internal function]: craft\controllers\PluginsController->actionInstallPlugin()

13 /data/sites/web/craftstart3-chillibe/checkout/master/6076e45d17611d536412ad56f5e2eb56b317af99/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)

14 /data/sites/web/craftstart3-chillibe/checkout/master/6076e45d17611d536412ad56f5e2eb56b317af99/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)

15 /data/sites/web/craftstart3-chillibe/checkout/master/6076e45d17611d536412ad56f5e2eb56b317af99/vendor/craftcms/cms/src/web/Controller.php(80): yii\base\Controller->runAction('install-plugin', Array)

16 /data/sites/web/craftstart3-chillibe/checkout/master/6076e45d17611d536412ad56f5e2eb56b317af99/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('install-plugin', Array)

17 /data/sites/web/craftstart3-chillibe/checkout/master/6076e45d17611d536412ad56f5e2eb56b317af99/vendor/craftcms/cms/src/web/Application.php(243): yii\base\Module->runAction('plugins/install...', Array)

18 /data/sites/web/craftstart3-chillibe/checkout/master/6076e45d17611d536412ad56f5e2eb56b317af99/vendor/craftcms/cms/src/web/Application.php(421): craft\web\Application->runAction('plugins/install...', Array)

19 /data/sites/web/craftstart3-chillibe/checkout/master/6076e45d17611d536412ad56f5e2eb56b317af99/vendor/craftcms/cms/src/web/Application.php(203): craft\web\Application->_processActionRequest(Object(craft\web\Request))

20 /data/sites/web/craftstart3-chillibe/checkout/master/6076e45d17611d536412ad56f5e2eb56b317af99/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))

21 /data/sites/web/craftstart3-chillibe/checkout/master/6076e45d17611d536412ad56f5e2eb56b317af99/www/index.php(23): yii\base\Application->run()

22 {main}`

engram-design commented 6 years ago

This should be fixed in the latest master (use composer require verbb/cp-nav:dev-craft-3 to update), and will be rolled into the next release.