craftcms / google-cloud

Google Cloud Storage volume type for Craft CMS.
https://plugins.craftcms.com/google-cloud
MIT License
11 stars 10 forks source link

After upgrading from Craft 2 to Craft 3, I get Twig Runtime Error when viewing volume settings #14

Closed tehtrav closed 4 years ago

tehtrav commented 4 years ago

I just upgraded from Craft 2 to Craft 3 and used my existing database. All my assets are obviously broken because I need to connect them to Google Cloud again but when I try to open any of my Google Cloud Storage asset volumes, I get a Twig error and so I can't load the page at all. The stack trace is below:

Twig\Error\RuntimeError: Key "1" for array with keys "0" does not exist. in /app/craft/vendor/craftcms/google-cloud/src/templates/volumeSettings.html:81
Stack trace:
#0 /app/craft/vendor/craftcms/cms/src/helpers/Template.php(96): twig_get_attribute(Object(craft\web\twig\Environment), Object(Twig\Source), Array, 1, Array, 'array', false, false)
#1 /app/craft/storage/runtime/compiled_templates/64/642c3ec4d665546cbf98e568604b15690bd5b3cb52f02668ab40ae5ed4c01dc9.php(117): craft\helpers\Template::attribute(Object(craft\web\twig\Environment), Object(Twig\Source), Array, 1, Array, 'array')
#2 /app/craft/vendor/twig/twig/src/Template.php(407): __TwigTemplate_8bd4289fdb3056a4f6a9146a25280ed2e287dc8eab9d0f8393966d0d372e39f8->doDisplay(Array, Array)
#3 /app/craft/vendor/twig/twig/src/Template.php(380): Twig\Template->displayWithErrorHandling(Array, Array)
#4 /app/craft/vendor/twig/twig/src/Template.php(392): Twig\Template->display(Array)
#5 /app/craft/vendor/twig/twig/src/TemplateWrapper.php(45): Twig\Template->render(Array, Array)
#6 /app/craft/vendor/twig/twig/src/Environment.php(318): Twig\TemplateWrapper->render(Array)
#7 /app/craft/vendor/craftcms/cms/src/web/View.php(397): Twig\Environment->render('google-cloud/vo...', Array)
#8 /app/craft/vendor/craftcms/google-cloud/src/Volume.php(96): craft\web\View->renderTemplate('google-cloud/vo...', Array)
#9 /app/craft/vendor/twig/twig/src/Extension/CoreExtension.php(1499): craft\googlecloud\Volume->getSettingsHtml()
#10 /app/craft/vendor/craftcms/cms/src/helpers/Template.php(96): twig_get_attribute(Object(craft\web\twig\Environment), Object(Twig\Source), Object(craft\googlecloud\Volume), 'getSettingsHtml', Array, 'method', false, false)
#11 /app/craft/storage/runtime/compiled_templates/d6/d6b482adb914acc1763fd44c655b8daa3844529a9715b5a7e5fb75a1be45c3ba.php(169): craft\helpers\Template::attribute(Object(craft\web\twig\Environment), Object(Twig\Source), Object(craft\googlecloud\Volume), 'getSettingsHtml', Array, 'method')
#12 /app/craft/vendor/twig/twig/src/Template.php(184): __TwigTemplate_7952de38cccf994fdeb0c80a90834c6fecf2defe49958e1ca9880c8fbe003197->block_content(Array, Array)
#13 /app/craft/storage/runtime/compiled_templates/15/15369041922af67941b41aa2f45f32d4520518a39a9b2a78a2cdfabde75544e9.php(411): Twig\Template->displayBlock('content', Array, Array)
#14 /app/craft/vendor/twig/twig/src/Template.php(184): __TwigTemplate_4dd3b7ac991adeb1c2e4cc143d86775c132f9e9875b1f205f787e821c8eee3a9->block_main(Array, Array)
#15 /app/craft/storage/runtime/compiled_templates/15/15369041922af67941b41aa2f45f32d4520518a39a9b2a78a2cdfabde75544e9.php(266): Twig\Template->displayBlock('main', Array, Array)
#16 /app/craft/vendor/twig/twig/src/Template.php(184): __TwigTemplate_4dd3b7ac991adeb1c2e4cc143d86775c132f9e9875b1f205f787e821c8eee3a9->block_body(Array, Array)
#17 /app/craft/storage/runtime/compiled_templates/cc/ccce923b35608428e05a678e2295e5d754256b0f11edf9c5de4622ff5bc72938.php(75): Twig\Template->displayBlock('body', Array, Array)
#18 /app/craft/vendor/twig/twig/src/Template.php(407): __TwigTemplate_875c66115cfb1ae7410b230c0afc22de9da1675db53c09b7be149be8659b2b2f->doDisplay(Array, Array)
#19 /app/craft/vendor/twig/twig/src/Template.php(380): Twig\Template->displayWithErrorHandling(Array, Array)
#20 /app/craft/storage/runtime/compiled_templates/ce/cec281bfcaf6f69d15b24d5a64c1b40bdb43b02bddf487ec1b901efc3847708c.php(56): Twig\Template->display(Array, Array)
#21 /app/craft/vendor/twig/twig/src/Template.php(407): __TwigTemplate_4b35dff44acc9d00c0d3524400e5dd691a8d3c128a00e37777b60fea0d357d48->doDisplay(Array, Array)
#22 /app/craft/vendor/twig/twig/src/Template.php(380): Twig\Template->displayWithErrorHandling(Array, Array)
#23 /app/craft/storage/runtime/compiled_templates/15/15369041922af67941b41aa2f45f32d4520518a39a9b2a78a2cdfabde75544e9.php(138): Twig\Template->display(Array, Array)
#24 /app/craft/vendor/twig/twig/src/Template.php(407): __TwigTemplate_4dd3b7ac991adeb1c2e4cc143d86775c132f9e9875b1f205f787e821c8eee3a9->doDisplay(Array, Array)
#25 /app/craft/vendor/twig/twig/src/Template.php(380): Twig\Template->displayWithErrorHandling(Array, Array)
#26 /app/craft/storage/runtime/compiled_templates/d6/d6b482adb914acc1763fd44c655b8daa3844529a9715b5a7e5fb75a1be45c3ba.php(58): Twig\Template->display(Array, Array)
#27 /app/craft/vendor/twig/twig/src/Template.php(407): __TwigTemplate_7952de38cccf994fdeb0c80a90834c6fecf2defe49958e1ca9880c8fbe003197->doDisplay(Array, Array)
#28 /app/craft/vendor/twig/twig/src/Template.php(380): Twig\Template->displayWithErrorHandling(Array, Array)
#29 /app/craft/vendor/twig/twig/src/Template.php(392): Twig\Template->display(Array)
#30 /app/craft/vendor/twig/twig/src/TemplateWrapper.php(45): Twig\Template->render(Array, Array)
#31 /app/craft/vendor/twig/twig/src/Environment.php(318): Twig\TemplateWrapper->render(Array)
#32 /app/craft/vendor/craftcms/cms/src/web/View.php(397): Twig\Environment->render('settings/assets...', Array)
#33 /app/craft/vendor/craftcms/cms/src/web/View.php(458): craft\web\View->renderTemplate('settings/assets...', Array)
#34 /app/craft/vendor/craftcms/cms/src/web/Controller.php(235): craft\web\View->renderPageTemplate('settings/assets...', Array, 'cp')
#35 /app/craft/vendor/craftcms/cms/src/controllers/VolumesController.php(162): craft\web\Controller->renderTemplate('settings/assets...', Array)
#36 [internal function]: craft\controllers\VolumesController->actionEditVolume(1, Object(craft\googlecloud\Volume))
#37 /app/craft/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#38 /app/craft/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#39 /app/craft/vendor/craftcms/cms/src/web/Controller.php(178): yii\base\Controller->runAction('edit-volume', Array)
#40 /app/craft/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('edit-volume', Array)
#41 /app/craft/vendor/craftcms/cms/src/web/Application.php(291): yii\base\Module->runAction('volumes/edit-vo...', Array)
#42 /app/craft/vendor/yiisoft/yii2/web/Application.php(103): craft\web\Application->runAction('volumes/edit-vo...', Array)
#43 /app/craft/vendor/craftcms/cms/src/web/Application.php(276): yii\web\Application->handleRequest(Object(craft\web\Request))
#44 /app/craft/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#45 /app/craft/web/index.php(22): yii\base\Application->run()
#46 {main}
andris-sevcenko commented 4 years ago

Fixed for next week's release!

andris-sevcenko commented 4 years ago

1.4.0 is out with now with this fix!