Describe your bug or feature request.
/admin/commerce crashes due to missing dependency.
If a bug, provide steps to reproduce it from a clean install.
1. drush en commerce
2. drush en commerce_store commerce_promotion
3. visit /admin/commerce
you have an error saying
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'cart' in 'where clause': SELECT COUNT(*) AS "expression" FROM (SELECT 1 AS "expression" FROM "commerce_order" "commerce_order" WHERE (("cart" = :db_condition_placeholder_0) AND ("created" >= :db_condition_placeholder_1)) OR (("cart" = :db_condition_placeholder_2) AND ("placed" >= :db_condition_placeholder_3))) "subquery"; Array ( [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => 1704236400 [:db_condition_placeholder_2] => 0 [:db_condition_placeholder_3] => 1704236400 ) in Drupal\commerce_order\Form\DashboardMetricsForm->getCartsCountForPeriod() (line 491 of /home/a/Public/d10/web/modules/contrib/commerce/modules/order/src/Form/DashboardMetricsForm.php).
4. drush en commerce_cart
3. visit /admin/commerce
you have no error now
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 3412057-4.patch | 3.59 KB | jsacksick |
Comments
Comment #2
jsacksick commentedOh... that affects 2.x as well... We should check that the cart module exists... Or even alter the form from commerce_cart.
Comment #3
afagioliOh, well...
Not being asked. I didn't suggest a solution.
It would be adding a the cart dependency into commerce_promotion.info.yml
Tested, it works.
Comment #4
jsacksick commentedThe attached patch should do the trick.
Comment #7
jsacksick commentedWent ahead and committed the fix, thank you for this report :).
Comment #8
afagioliThanks for being so prompt :)
Best!
Comment #9
jsacksick commentedDid this fix the issue for you?
Comment #11
rishabjasrotia commentedI had similar issue post installation on existing site.
While the patch is not able to solve the problem!
Comment #12
jsacksick commented@rishabjasrotia: Did you try updating to the latest version? 2.38?
Comment #13
rishabjasrotia commented@jsacksick
Yes I am using the latest version.
"drupal/commerce": "^2.38"
I also notice that this patch solution is present in latest version.
Strange even the commerce_cart module is enabled.
Comment #14
rishabjasrotia commentedAlso there is no `cart` column in database table also.
I have verified it
See below: