AcroMedia / commerce-demo

Repo for the Urban Hipster Drupal Commerce demo website built on Drupal 8.
https://commerce.acromedia.com
GNU General Public License v2.0
101 stars 63 forks source link

error on dbupdate after composer update #29

Open nigelwhite opened 5 years ago

nigelwhite commented 5 years ago

$ composer update --with-dependencies drupal/commerce drupal/commerce_price drupal/commerce_product drupal/commerce_order drupal/commerce_payment drupal/commerce_payment_example drupal/commerce_checkout drupal/commerce_tax drupal/commerce_cart drupal/commerce_log drupal/commerce_store drupal/commerce_promotion $ vendor/drush/drush/drush updb

Module Update ID Type Description


commerce_product 8206 hook_update_n Set the 'published' entity key for variations.
commerce_product 8207 hook_update_n Update the variation 'status' field.
commerce_promotion 10 post-update Re-save order item promotions to populate the display_included field.

PHP Fatal error: Declaration of Drupal\commerce_promotion\Entity\Promotion::apply(Drupal\commerce_order\Entity\OrderInterface $order) must be compatible with Drupal\commerce_promotion\Entity\PromotionInterface::apply(Drupal\commerce_order\Entity\OrderInterface $order, ?Drupal\commerce_promotion\Entity\CouponInterface $coupon = NULL) in /home/qpc/docker-sites/ddev/demos/commerce-demo/web/modules/contrib/commerce/modules/promotion/src/Entity/Promotion.php on line 75 [error] Drush command terminated abnormally due to an unrecoverable error. Error: Declaration of Drupal\commerce_promotion\Entity\Promotion::apply(Drupal\commerce_order\Entity\OrderInterface $order) must be compatible with Drupal\commerce_promotion\Entity\PromotionInterface::apply(Drupal\commerce_order\Entity\OrderInterface $order, ?Drupal\commerce_promotion\Entity\CouponInterface $coupon = NULL) in /home/qpc/docker-sites/ddev/demos/commerce-demo/web/modules/contrib/commerce/modules/promotion/src/Entity/Promotion.php, line 75

site broken

Its hard to tell now which version I was updating from, but I think it was commerce: 2.11.0 and trying to go up to 2.13. In Drupal 8.6.13

ghost commented 5 years ago

Hmmm. You could try updating via update.php instead of with drush. Also, try drush entup.

thegbomb commented 5 years ago

Patches need updating:

         "patches": {
             "drupal/commerce": {
                 "#2770731: Add a display name to promotions":
-                "https://www.drupal.org/files/issues/2018-07-23/adjustment_label-2770731-44.patch",
+                "https://www.drupal.org/files/issues/2019-04-15/adjustment-label-update-2770731-51.patch",
                 "#2852207: Billing same as shipping":
-                "https://www.drupal.org/files/issues/2018-05-23/commerce_checkbox-same-as-billing_2852207_166.patch",
-                "#2938760: Variation fields can permanently disappear during ajax replacement":
-                "https://www.drupal.org/files/issues/2018-10-31/2938760-20.patch"
+                "https://www.drupal.org/files/issues/2018-05-23/commerce_checkbox-same-as-billing_2852207_166.patch"
             },

2852207: Billing same as shipping isn't applying either but it looks like there are bigger things to solve in that issue and so there isn't a patch to replace this one, however the site doesn't seem to have the above fatal errors without it being applied.

thegbomb commented 5 years ago

The other way to fix it is to pin commerce to version 2.11 where the patches seem to still apply:

-        "drupal/commerce": "^2.9",
+        "drupal/commerce": "2.11",