You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to duplicate a product via Save as a new product, an exception is thrown, though the exception is also bugged.
Argument 3 passed to yii\web\ServerErrorHttpException::__construct() must be an instance of Exception or null, instance of Error given, called in /<path>/craftcms/vendor/craftcms/commerce/src/controllers/ProductsController.php on line 264
The line in question:
in /<path>/craftcms/vendor/craftcms/commerce/src/controllers/ProductsController.php at line 263 – yii\web\ServerErrorHttpException::__construct('An error occurred when duplicati...', 0, Error)
If I go in and die with that error (rather than throwing the exception), I find the source of the issue:
Call to a member function getSkuAsText() on null
This appears to be happening in src/elements/Product.php here:
When attempting to duplicate a product via Save as a new product, an exception is thrown, though the exception is also bugged.
Argument 3 passed to yii\web\ServerErrorHttpException::__construct() must be an instance of Exception or null, instance of Error given, called in /<path>/craftcms/vendor/craftcms/commerce/src/controllers/ProductsController.php on line 264
The line in question:
in /<path>/craftcms/vendor/craftcms/commerce/src/controllers/ProductsController.php at line 263 – yii\web\ServerErrorHttpException::__construct('An error occurred when duplicati...', 0, Error)
If I go in and die with that error (rather than throwing the exception), I find the source of the issue:
Call to a member function getSkuAsText() on null
This appears to be happening in src/elements/Product.php here:
$record->defaultSku = $this->getDefaultVariant()->getSkuAsText();
I have confirmed that all products have default variants set, and I have tried resaving them as well just to be sure.
The text was updated successfully, but these errors were encountered: