craftcms / aws-s3

Amazon S3 volume type for Craft CMS.
https://plugins.craftcms.com/aws-s3
MIT License
61 stars 28 forks source link

Setting unknown property: craft\awss3\Volume::path #134

Closed VesninAndrey closed 2 years ago

VesninAndrey commented 2 years ago

Description

Similar:

https://github.com/craftcms/aws-s3/issues/99

Steps to reproduce

  1. Create LocalVolume.
  2. Create path in that volume.
  3. Change the volume type from LocalVolume to AWS S3.
  4. Save the Volume and get exception.
Trace
yii\base\UnknownPropertyException: Setting unknown property: craft\awss3\Volume::path in /app/vendor/yiisoft/yii2/base/Component.php:210
Stack trace:
#0 /app/vendor/yiisoft/yii2/BaseYii.php(558): yii\base\Component->__set('path', '/uploads')
#1 /app/vendor/yiisoft/yii2/base/BaseObject.php(107): yii\BaseYii::configure(Object(craft\awss3\Volume), Array)
#2 /app/vendor/craftcms/aws-s3/src/Volume.php(165): yii\base\BaseObject->__construct(Array)
#3 [internal function]: craft\awss3\Volume->__construct(Array)
#4 /app/vendor/yiisoft/yii2/di/Container.php(420): ReflectionClass->newInstanceArgs(Array)
#5 /app/vendor/yiisoft/yii2/di/Container.php(171): yii\di\Container->build('craft\\awss3\\Vol...', Array, Array)
#6 /app/vendor/yiisoft/yii2/BaseYii.php(365): yii\di\Container->get('craft\\awss3\\Vol...', Array, Array)
#7 /app/vendor/craftcms/cms/src/Craft.php(67): yii\BaseYii::createObject(Array, Array)
#8 /app/vendor/craftcms/cms/src/helpers/Component.php(111): Craft::createObject(Array)
#9 /app/vendor/craftcms/cms/src/services/Volumes.php(556): craft\helpers\Component::createComponent(Array, 'craft\\base\\Volu...')
#10 /app/vendor/craftcms/cms/src/services/Volumes.php(226): craft\services\Volumes->createVolume(Array)
#11 /app/vendor/craftcms/cms/src/services/Volumes.php(241): craft\services\Volumes->_volumes()
#12 /app/vendor/craftcms/cms/src/services/Volumes.php(171): craft\services\Volumes->getAllVolumes()
#13 /app/vendor/craftcms/cms/src/services/Volumes.php(213): craft\services\Volumes->getViewableVolumes()
#14 /app/vendor/craftcms/cms/src/web/twig/variables/Cp.php(222): craft\services\Volumes->getTotalViewableVolumes()
#15 /app/vendor/twig/twig/src/Extension/CoreExtension.php(1511): craft\web\twig\variables\Cp->nav()
#16 /app/vendor/craftcms/cms/src/helpers/Template.php(106): twig_get_attribute(Object(craft\web\twig\Environment), Object(Twig\Source), Object(craft\web\twig\variables\Cp), 'nav', Array, 'method', false, false)
#17 /app/storage/runtime/compiled_templates/21/2121614b165d9342bc978201a90fd276fc2888ee2c241ac6ab670ccbaeba0ab9.php(78): craft\helpers\Template::attribute(Object(craft\web\twig\Environment), Object(Twig\Source), Object(craft\web\twig\variables\Cp), 'nav', Array, 'method')
#18 /app/vendor/twig/twig/src/Template.php(405): __TwigTemplate_9cb0c5d35d6f69fbd1735d87ebb872ba93adaf0a05ec79a821f6bfbc76cd6e42->doDisplay(Array, Array)
#19 /app/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling(Array, Array)
#20 /app/storage/runtime/compiled_templates/7e/7e2723dd70cefdec4c32d4d7173030cea5fcac8a07d5189919428edc3f318b5f.php(178): Twig\Template->display(Array)
#21 /app/vendor/twig/twig/src/Template.php(182): __TwigTemplate_295ea465f853766666d782ff7379c63c3216ef4404536c76e79dbd3c64bd7415->block_body(Array, Array)
#22 /app/storage/runtime/compiled_templates/15/159ce80be2919df583b2051a3609386cd1412930eb8491206471b5d0bf755612.php(96): Twig\Template->displayBlock('body', Array, Array)
#23 /app/vendor/twig/twig/src/Template.php(405): __TwigTemplate_28514bbc157ac37fc33abd9d0d0b64a6c817e29acf3ab080a4d3acf0cfa6dfa3->doDisplay(Array, Array)
#24 /app/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling(Array, Array)
#25 /app/storage/runtime/compiled_templates/2d/2d3a02b742343223b5a80b542abb53c22338ced343f8c885fa12a79a6f77d9f2.php(56): Twig\Template->display(Array, Array)
#26 /app/vendor/twig/twig/src/Template.php(405): __TwigTemplate_dd0bce186af885421c7fbe56ac6c763764205079e53bad9afd3d34d6ad9d1a29->doDisplay(Array, Array)
#27 /app/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling(Array, Array)
#28 /app/storage/runtime/compiled_templates/7e/7e2723dd70cefdec4c32d4d7173030cea5fcac8a07d5189919428edc3f318b5f.php(165): Twig\Template->display(Array, Array)
#29 /app/vendor/twig/twig/src/Template.php(405): __TwigTemplate_295ea465f853766666d782ff7379c63c3216ef4404536c76e79dbd3c64bd7415->doDisplay(Array, Array)
#30 /app/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling(Array, Array)
#31 /app/storage/runtime/compiled_templates/d2/d27bfc55e01dfa68b6de6007ca396583150bb1c18ef7cf6abfcf5eca2981ed37.php(47): Twig\Template->display(Array, Array)
#32 /app/vendor/twig/twig/src/Template.php(405): __TwigTemplate_fcaca3f90e651356f4b2e96e6433c9ff699170c1d2cc0fbfe7b841975820c42a->doDisplay(Array, Array)
#33 /app/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling(Array, Array)
#34 /app/vendor/twig/twig/src/Template.php(390): Twig\Template->display(Array)
#35 /app/vendor/twig/twig/src/TemplateWrapper.php(45): Twig\Template->render(Array, Array)
#36 /app/vendor/twig/twig/src/Environment.php(318): Twig\TemplateWrapper->render(Array)
#37 /app/vendor/craftcms/cms/src/web/View.php(408): Twig\Environment->render('dashboard/_inde...', Array)
#38 /app/vendor/craftcms/cms/src/web/View.php(461): craft\web\View->renderTemplate('dashboard/_inde...', Array)
#39 /app/vendor/craftcms/cms/src/web/Controller.php(201): craft\web\View->renderPageTemplate('dashboard/_inde...', Array, 'cp')
#40 /app/vendor/craftcms/cms/src/controllers/DashboardController.php(142): craft\web\Controller->renderTemplate('dashboard/_inde...', Array)
#41 [internal function]: craft\controllers\DashboardController->actionIndex()
#42 /app/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#43 /app/vendor/yiisoft/yii2/base/Controller.php(181): yii\base\InlineAction->runWithParams(Array)
#44 /app/vendor/yiisoft/yii2/base/Module.php(534): yii\base\Controller->runAction('index', Array)
#45 /app/vendor/craftcms/cms/src/web/Application.php(287): yii\base\Module->runAction('dashboard/index', Array)
#46 /app/vendor/yiisoft/yii2/web/Application.php(104): craft\web\Application->runAction('dashboard/index', Array)
#47 /app/vendor/craftcms/cms/src/web/Application.php(272): yii\web\Application->handleRequest(Object(craft\web\Request))
#48 /app/vendor/yiisoft/yii2/base/Application.php(392): craft\web\Application->handleRequest(Object(craft\web\Request))
#49 /app/web/index.php(21): yii\base\Application->run()
#50 {main}

Additional info

VesninAndrey commented 2 years ago

Fixed after removing "config/volumes.php"