diff --git a/vendor/magento/module-customer-custom-attributes/Model/ResourceModel/Sales/AbstractSales.php b/vendor/magento/module-customer-custom-attributes/Model/ResourceModel/Sales/AbstractSales.php index e16042cd386..5033d96960b 100644 --- a/vendor/magento/module-customer-custom-attributes/Model/ResourceModel/Sales/AbstractSales.php +++ b/vendor/magento/module-customer-custom-attributes/Model/ResourceModel/Sales/AbstractSales.php @@ -103,6 +103,7 @@ abstract class AbstractSales extends \Magento\Framework\Model\ResourceModel\Db\A /** * Check if main entity exists in main table. + * * Need to prevent errors in case of multiple customer log in into one account. * * @param \Magento\CustomerCustomAttributes\Model\Sales\AbstractSales $sales @@ -127,11 +128,9 @@ abstract class AbstractSales extends \Magento\Framework\Model\ResourceModel\Db\A $select = $this->getConnection()->select()->from( $parentTable, $parentIdField - )->forUpdate( - true )->where( "{$parentIdField} = ?", - $sales->getId() + (int) $sales->getId() ); if ($this->getConnection()->fetchOne($select)) { return true;