-
Notifications
You must be signed in to change notification settings - Fork 174
[4.7] Performance improvements to shipping rule order condition formula matching #3653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Conflicts: # CHANGELOG-WIP.md
| // Get the cart from the request or from the session. | ||
| // When we are about to update the cart, we consider it a real cart at this point, and want to actually create it in the DB. | ||
| $this->_cart = $this->_getCart(true); | ||
| $this->_cart = $this->_getCart(); |
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't force save it anymore, so it may not actually be created in the db? For me this results in errors when adding notices, since sometimes they don't have orderIds anymore, which cannot be null:
2024-12-20 14:02:23 [web.ERROR] [yii\db\IntegrityException] SQLSTATE[23502]: Not null violation: 7 ERROR: null value in column "orderId" of relation "commerce_ordernotices" violates not-null constraint DETAIL: Failing row contains (374272, null, lineItemSalePriceChanged, lineItems..qty, Comfort Edition | Rechthoekig / 366x244cm / Zwart / 5093A heeft ..., 2024-12-20 13:02:23, 2024-12-20 13:02:23, 86939cb3-315e-4beb-a633-449631b45f5f). The SQL being executed was: INSERT INTO "commerce_ordernotices" ("orderId", "type", "attribute", "message", "dateCreated", "dateUpdated", "uid") VALUES (NULL, 'lineItemSalePriceChanged', 'lineItems..qty', 'Comfort Edition | Rechthoekig / 366x244cm / Zwart / 5093A heeft maar 0 op voorraad.', '2024-12-20 13:02:23', '2024-12-20 13:02:23', '86939cb3-315e-4beb-a633-449631b45f5f') RETURNING "id" {"trace":["#0 /app/vendor/yiisoft/yii2/db/Command.php(1325): yii\\db\\Schema->convertException()","#1 /app/vendor/yiisoft/yii2/db/Command.php(1186): yii\\db\\Command->internalExecute()","#2 /app/vendor/yiisoft/yii2/db/Command.php(431): yii\\db\\Command->queryInternal()","#3 /app/vendor/yiisoft/yii2/db/pgsql/Schema.php(646): yii\\db\\Command->queryOne()","#4 /app/vendor/yiisoft/yii2/db/ActiveRecord.php(604): yii\\db\\pgsql\\Schema->insert()","#5 /app/vendor/yiisoft/yii2/db/ActiveRecord.php(570): yii\\db\\ActiveRecord->insertInternal()","#6 /app/vendor/yiisoft/yii2/db/BaseActiveRecord.php(688): yii\\db\\ActiveRecord->insert()","#7 /app/vendor/craftcms/commerce/src/elements/Order.php(3467): yii\\db\\BaseActiveRecord->save()","#8 /app/vendor/craftcms/commerce/src/elements/Order.php(2196): craft\\commerce\\elements\\Order->_saveNotices()","#9 /app/vendor/craftcms/cms/src/services/Elements.php(3450): craft\\commerce\\elements\\Order->afterSave()","#10 /app/vendor/craftcms/cms/src/services/Elements.php(1109): craft\\services\\Elements->_saveElementInternal()","#11 /app/vendor/craftcms/commerce/src/controllers/CartController.php(525): craft\\services\\Elements->saveElement()","#12 /app/vendor/craftcms/commerce/src/controllers/CartController.php(327): craft\\commerce\\controllers\\CartController->_returnCart()","#13 [internal function]: craft\\commerce\\controllers\\CartController->actionUpdateCart()","#14 /app/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()","#15 /app/vendor/yiisoft/yii2/base/Controller.php(178): yii\\base\\InlineAction->runWithParams()","#16 /app/vendor/yiisoft/yii2/base/Module.php(552): yii\\base\\Controller->runAction()","#17 /app/vendor/craftcms/cms/src/web/Application.php(341): yii\\base\\Module->runAction()","#18 /app/vendor/craftcms/cms/src/web/Application.php(640): craft\\web\\Application->runAction()","#19 /app/vendor/craftcms/cms/src/web/Application.php(303): craft\\web\\Application->_processActionRequest()","#20 /app/vendor/yiisoft/yii2/base/Application.php(384): craft\\web\\Application->handleRequest()","#21 /app/web/index.php(28): yii\\base\\Application->run()","#22 {main}"],"memory":14758936,"exception":"[object] (yii\\db\\IntegrityException(code: 23502): SQLSTATE[23502]: Not null violation: 7 ERROR: null value in column \"orderId\" of relation \"commerce_ordernotices\" violates not-null constraint\nDETAIL: Failing row contains (374272, null, lineItemSalePriceChanged, lineItems..qty, Comfort Edition | Rechthoekig / 366x244cm / Zwart / 5093A heeft ..., 2024-12-20 13:02:23, 2024-12-20 13:02:23, 86939cb3-315e-4beb-a633-449631b45f5f).\nThe SQL being executed was: INSERT INTO \"commerce_ordernotices\" (\"orderId\", \"type\", \"attribute\", \"message\", \"dateCreated\", \"dateUpdated\", \"uid\") VALUES (NULL, 'lineItemSalePriceChanged', 'lineItems..qty', 'Comfort Edition | Rechthoekig / 366x244cm / Zwart / 5093A heeft maar 0 op voorraad.', '2024-12-20 13:02:23', '2024-12-20 13:02:23', '86939cb3-315e-4beb-a633-449631b45f5f') RETURNING \"id\" at /app/vendor/yiisoft/yii2/db/Schema.php:676)\n[previous exception] [object] (PDOException(code: 23502): SQLSTATE[23502]: Not null violation: 7 ERROR: null value in column \"orderId\" of relation \"commerce_ordernotices\" violates not-null constraint\nDETAIL: Failing row contains (374272, null, lineItemSalePriceChanged, lineItems..qty, Comfort Edition | Rechthoekig / 366x244cm / Zwart / 5093A heeft ..., 2024-12-20 13:02:23, 2024-12-20 13:02:23, 86939cb3-315e-4beb-a633-449631b45f5f). at /app/vendor/yiisoft/yii2/db/Command.php:1320)"}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.