Closed benfeather closed 6 months ago
@benfeather I am unable to reproduce this issue. It looks like you have no store with the store handle attempted to be accessed from the URL. Can you confirm you have the store in the project config and database with that handle?
Can you make sure you clear any template caches with ddev craft clear-caches/all
.
I cleared the cache and disabled all of my plugins, but I still had the same issue.
I was able to fix the problem by:
ddev composer clear-cache
I'm not sure what happened, but this issue is resolved; thank you for your help.
P.S. Craft 5 is looking great; I'm really looking forward to the full release. Keep up the excellent work.
Ok, this is strange. The error just happened again.
Each of these pages throws the same error:
Twig\Error\RuntimeError: Impossible to access an attribute ("name") on a null variable. in /var/www/html/vendor/craftcms/commerce/src/templates/_layouts/store-management.twig:14
Stack trace:
#0 /var/www/html/vendor/craftcms/cms/src/helpers/Template.php(129): twig_get_attribute(Object(craft\web\twig\Environment), Object(Twig\Source), NULL, 'name', Array, 'any', false, false)
#1 /var/www/html/storage/runtime/compiled_templates/db/db3faf5001544eb3a150b0c235c840ce.php(64): craft\helpers\Template::attribute(Object(craft\web\twig\Environment), Object(Twig\Source), NULL, 'name', Array)
#2 /var/www/html/vendor/twig/twig/src/Template.php(394): __TwigTemplate_d80ea5c574405a41441cd388758956cd->doDisplay(Array, Array)
#3 /var/www/html/vendor/twig/twig/src/Template.php(367): Twig\Template->displayWithErrorHandling(Array, Array)
#4 /var/www/html/storage/runtime/compiled_templates/23/23da377f2ca9ec3be012050b75bb1846.php(151): Twig\Template->display(Array, Array)
#5 /var/www/html/vendor/twig/twig/src/Template.php(394): __TwigTemplate_11107a6a3456fd3f45080e71c0df3d8e->doDisplay(Array, Array)
#6 /var/www/html/vendor/twig/twig/src/Template.php(367): Twig\Template->displayWithErrorHandling(Array, Array)
#7 /var/www/html/vendor/twig/twig/src/Template.php(379): Twig\Template->display(Array)
#8 /var/www/html/vendor/twig/twig/src/TemplateWrapper.php(38): Twig\Template->render(Array)
#9 /var/www/html/vendor/twig/twig/src/Environment.php(280): Twig\TemplateWrapper->render(Array)
#10 /var/www/html/vendor/craftcms/cms/src/web/View.php(482): Twig\Environment->render('commerce/store-...', Array)
#11 /var/www/html/vendor/craftcms/cms/src/web/View.php(535): craft\web\View->renderTemplate('commerce/store-...', Array)
#12 /var/www/html/vendor/craftcms/cms/src/web/TemplateResponseFormatter.php(57): craft\web\View->renderPageTemplate('commerce/store-...', Array, 'cp')
#13 /var/www/html/vendor/yiisoft/yii2/web/Response.php(1100): craft\web\TemplateResponseFormatter->format(Object(craft\web\Response))
#14 /var/www/html/vendor/craftcms/cms/src/web/Response.php(337): yii\web\Response->prepare()
#15 /var/www/html/vendor/yiisoft/yii2/web/Response.php(340): craft\web\Response->prepare()
#16 /var/www/html/vendor/yiisoft/yii2/base/Application.php(390): yii\web\Response->send()
#17 /var/www/html/web/index.php(17): yii\base\Application->run()
#18 {main}
I have uninstalled all plugins except for Craft Commerce.
I have two stores and two sites set up like so:
Sites
Shops
Shop & Site
NZ config:
AU config:
@benfeather is this from a fresh install that already had a project config in place with multi-site?
Could you send your config folder (which includes the project config) and DB Backup and composer.json and composer.lock to support@craftcms.com and reference this issue? We can then take a look. Thanks for reporting.
@benfeather What does the URL look like when you get that error?
Here's the URL: https://craft-5.ddev.site/commerce/store-management/tepariNZ/inventory-locations?site=tepariNZ
This was a fresh install when the first Craft 5 Alpha was released.
I have sent the files to the support email.
@benfeather Could you update to the latest on the develop branch:
change your craftcms/commerce
requirement in composer.json to:
"require": {
"craftcms/commerce": "dev-5.0#c6fc6590d47e9b4c144825e6e907e11375faa0ca as 5.0.0-beta.1",
"...": "..."
}
Then run composer update
.
After that run Ultilities > Project Config > Rebuild
And let me know if that fixes it. Thanks.
I can't install that version using composer:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires craftcms/commerce dev-5.0#c6fc6590d47e9b4c144825e6e907e11375faa0ca as 5.0.0-beta.1, found craftcms/commerce[dev-zarchive/order-edit-line-item-options, ..., dev-patch-1, 0.9.1170, ..., 0.9.1176, 1.0.1182, ..., 1.2.1334, 2.0.0-beta.1, ..., 2.2.27, 3.0.0-alpha.1, ..., v3.x-dev, 4.0.0-beta.1, ..., 4.5.2, 5.0.0-beta.1, 5.0.x-dev] but it does not match the constraint.
Composer [update] failed, composer command failed: exit status 2.
Hi @benfeather
Can you try the following in your composer file:
"require": {
"craftcms/commerce": "5.0.x-dev#c6fc6590d47e9b4c144825e6e907e11375faa0ca as 5.0.0-beta.1",
"...": "..."
}
Then run composer update
. Hopefully this should get you pointing to the correct commit
I installed that version and rebuilt the config, but I still get that error on the store management pages.
Closing as this was resolved via support. Project related issue and not a Commerce bug.
What happened?
Description
Craft commerce throws an error when accessing a subpage under the "Store management" section in the Craft CMS dashboard:
Steps to reproduce
Expected behavior
No error.
Actual behavior
Has error.
Craft CMS version
5.0.0-beta.6
Craft Commerce version
5.0.0-beta.1
PHP version
8.2.15
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions