verbb / abandoned-cart

Abandoned Cart plugin for Craft Commerce
Other
1 stars 15 forks source link

Key "0" does not exist as the array is empty #8

Closed sunscreem closed 5 years ago

sunscreem commented 5 years ago

Hey @mediabeastnz,

Sorry to 'bug' you on this but I'm hoping to get this shipped to the client (and you paid) next week, so I'm hoping you can shortcut the bug solving process.

I'm now getting this when I click on Abandoned Carts menu option in the control panel :(

Any ideas? Maybe something we've done?

Twig\Error\RuntimeError: Key "0" does not exist as the array is empty. in /home/vagrant/Code/jamieson-carry/vendor/mediabeastnz/craft-commerce-abandoned-cart/src/templates/index.twig:64
Stack trace:
#0 /home/vagrant/Code/[clientsite]/vendor/craftcms/cms/src/helpers/Template.php(79): twig_get_attribute(Object(craft\web\twig\Environment), Object(Twig\Source), Array, 0, Array, 'array', false, false)
#1 /home/vagrant/Code/[clientsite]/storage/runtime/compiled_templates/c7/c728a12cd76127c7327977b8b1d0a5468fdf4550760072f2c49cf94bbeeb2ccb.php(142): craft\helpers\Template::attribute(Object(craft\web\twig\Environment), Object(Twig\Source), Array, 0, Array, 'array')
#2 /home/vagrant/Code/[clientsite]/vendor/twig/twig/src/Template.php(382): __TwigTemplate_70f8ba16b229deeeb79c177bff24d812ee5a087edbea508cede2b542e118921e->doDisplay(Array, Array)
#3 /home/vagrant/Code/[clientsite]/vendor/craftcms/cms/src/web/twig/Template.php(52): Twig\Template->displayWithErrorHandling(Array, Array)
#4 /home/vagrant/Code/[clientsite]/vendor/twig/twig/src/Template.php(359): craft\web\twig\Template->displayWithErrorHandling(Array, Array)
#5 /home/vagrant/Code/[clientsite]/vendor/craftcms/cms/src/web/twig/Template.php(34): Twig\Template->display(Array, Array)
#6 /home/vagrant/Code/[clientsite]/vendor/twig/twig/src/Template.php(367): craft\web\twig\Template->display(Array)
#7 /home/vagrant/Code/[clientsite]/vendor/twig/twig/src/TemplateWrapper.php(45): Twig\Template->render(Array, Array)
#8 /home/vagrant/Code/[clientsite]/vendor/twig/twig/src/Environment.php(318): Twig\TemplateWrapper->render(Array)
#9 /home/vagrant/Code/[clientsite]/vendor/craftcms/cms/src/web/View.php(343): Twig\Environment->render('abandoned-cart/...', Array)
#10 /home/vagrant/Code/[clientsite]/vendor/craftcms/cms/src/web/View.php(393): craft\web\View->renderTemplate('abandoned-cart/...', Array)
#11 /home/vagrant/Code/[clientsite]/vendor/craftcms/cms/src/web/Controller.php(161): craft\web\View->renderPageTemplate('abandoned-cart/...', Array)
#12 /home/vagrant/Code/[clientsite]/vendor/mediabeastnz/craft-commerce-abandoned-cart/src/controllers/BaseController.php(75): craft\web\Controller->renderTemplate('abandoned-cart/...', Array)
#13 [internal function]: mediabeastnz\abandonedcart\controllers\BaseController->actionIndex()
#14 /home/vagrant/Code/[clientsite]/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#15 /home/vagrant/Code/[clientsite]/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#16 /home/vagrant/Code/[clientsite]/vendor/craftcms/cms/src/web/Controller.php(109): yii\base\Controller->runAction('index', Array)
#17 /home/vagrant/Code/[clientsite]/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('index', Array)
#18 /home/vagrant/Code/[clientsite]/vendor/craftcms/cms/src/web/Application.php(297): yii\base\Module->runAction('abandoned-cart/...', Array)
#19 /home/vagrant/Code/[clientsite]/vendor/yiisoft/yii2/web/Application.php(103): craft\web\Application->runAction('abandoned-cart/...', Array)
#20 /home/vagrant/Code/[clientsite]/vendor/craftcms/cms/src/web/Application.php(286): yii\web\Application->handleRequest(Object(craft\web\Request))
#21 /home/vagrant/Code/[clientsite]/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#22 /home/vagrant/Code/[clientsite]/web/index.php(25): yii\base\Application->run()
#23 {main}
mediabeastnz commented 5 years ago

I'll try and replicate and put a fix in place. Maybe try wiping all orders for now (if possible). @sunscreem i'll be looking into your other questions over the next 2 days, i'll try and be speedy seeing as you're wanting to launch next week.

mediabeastnz commented 5 years ago

Latest release (1.1.3) fixes this issue.

sunscreem commented 5 years ago

@mediabeastnz FYI this fixed the issue thank you. Back to testing today.