Closed mlocati closed 5 months ago
When the "Calculate automatically the quantities for products with variations" option is enabled, we may encounter this error when creating a new product with variations:
Doctrine\DBAL\Exception\DriverException thrown with message "An exception occurred while executing 'INSERT INTO CommunityStoreProducts (cID, pName, pSKU, pBarcode, pDesc, pDetail, pPrice, pWholesalePrice, pCostPrice, pSalePrice, pSaleStart, pSaleEnd, pCustomerPrice, pPriceMaximum, pPriceMinimum, pPriceSuggestions, pQuantityPrice, pFeatured, pQty, pQtyUnlim, pDateAvailableStart, pDateAvailableEnd, pOutOfStockMessage, pAddToCartText, pBackOrder, pNoQty, pAllowDecimalQty, pQtySteps, pQtyLabel, pMaxQty, pTaxClass, pTaxable, pfID, pActive, pDateAdded, pDateUpdated, pShippable, pWidth, pHeight, pStackedHeight, pLength, pWeight, pNumberItems, pSeperateShip, pPackageData, pCreateUserAccount, pAutoCheckout, pOrderCompleteCID, pExclusive, pVariations, pNotificationEmails, pManufacturer, pType) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [0]: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens"
(please remark the empty params).
I think the solution is to use recomputeSingleEntityChangeSet() instead of computeChangeSet() (at least this seems to fix this issue).
recomputeSingleEntityChangeSet()
computeChangeSet()
When the "Calculate automatically the quantities for products with variations" option is enabled, we may encounter this error when creating a new product with variations:
(please remark the empty params).
I think the solution is to use
recomputeSingleEntityChangeSet()
instead ofcomputeChangeSet()
(at least this seems to fix this issue).