Closed dmitrii-fediuk closed 1 year ago
https://github.com/magento/magento2/issues/7387#issuecomment-260896083
I realise the checkout works without my test extension - because the core code statement causing the bug is not executed during this flow. There is a bug in your code when you save a UK address without a region ($address->save()).
https://github.com/magento/magento2/issues/7387#issuecomment-262126410
I have reproduced it on the /checkout/cart/
page:
mage2pro/core: 9.8.3
Magento: 2.3.7-p4
PHP: 7.4.9
IP Address: 158.181.235.66
Referer: https://localhost.com:2197/checkout/cart/
Request Method: POST
URL: https://localhost.com:2197/rest/default/V1/carts/mine/estimate-shipping-methods-by-address-id
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
php://input: {"addressId":"53124"}
File: vendor/magento/framework/DB/Adapter/Pdo/Mysql.php
Line: 3102
************************************
[E_ERROR] Uncaught Error: Object of class Magento\Customer\Model\Data\Region could not be converted to string in vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:3102
Stack trace:
#0 generated/code/Magento/Framework/DB/Adapter/Pdo/Mysql/Interceptor.php(817): Magento\Framework\DB\Adapter\Pdo\Mysql->prepareColumnValue(Array, Object(Magento\Customer\Model\Data\Region))
#1 vendor/magento/framework/Model/ResourceModel/AbstractResource.php(184): Magento\Framework\DB\Adapter\Pdo\Mysql\Interceptor->prepareColumnValue(Array, Object(Magento\Customer\Model\Data\Region))
#2 vendor/magento/framework/Model/ResourceModel/Db/AbstractDb.php(750): Magento\Framework\Model\ResourceModel\AbstractResource->_prepareDataForTable(Object(Magento\Quote\Model\Quote\Address\Interceptor), 'quote_address')
mage2pro/core: 10.0.7
Magento: 2.3.7-p4
PHP: 7.4.9
IP Address: 158.181.235.66
Referer: https://localhost.com:2197/checkout/cart/
Request Method: POST
URL: https://localhost.com:2197/rest/default/V1/carts/mine/estimate-shipping-methods-by-address-id
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
php://input: {"addressId":"53124"}
File: vendor/magento/framework/DB/Adapter/Pdo/Mysql.php
Line: 3102
************************************
[E_ERROR] Uncaught Error: Object of class Magento\Customer\Model\Data\Region could not be converted to string in vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:3102
Stack trace:
#0 generated/code/Magento/Framework/DB/Adapter/Pdo/Mysql/Interceptor.php(817): Magento\Framework\DB\Adapter\Pdo\Mysql->prepareColumnValue(Array, Object(Magento\Customer\Model\Data\Region))
#1 vendor/magento/framework/Model/ResourceModel/AbstractResource.php(184): Magento\Framework\DB\Adapter\Pdo\Mysql\Interceptor->prepareColumnValue(Array, Object(Magento\Customer\Model\Data\Region))
#2 vendor/magento/framework/Model/ResourceModel/Db/AbstractDb.php(750): Magento\Framework\Model\ResourceModel\AbstractResource->_prepareDataForTable(Object(Magento\Quote\Model\Quote\Address\Interceptor), 'quote_address')
/checkout/cart
pageDELETE FROM quote_shipping_rate
E.g.:
mysql -D tradefurniturecompany_co_uk_2020_11_09 -e "DELETE FROM quote_shipping_rate";
rm -rf var/cache var/log var/page_cache var/view_preprocessed
Delete the Local Storage content from the browser.
Reload the page in the browser.
https://github.com/magento/magento2/issues/4187, https://github.com/magento/magento2/issues/7387, https://github.com/magento/magento2/issues/12436
https://github.com/magento/magento2/issues/4187#issuecomment-255110528
github.com/magento/magento2/issues/4187#issuecomment-259368636