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
I am unable to programmatically create a custom field, and subsequently assign it to a Product. It works for User, and for Order, but not for Product. I suspect it's related to Product delegating to ProductType for its field layout under certain circumstances, but I can't work it out. I'd be happy to be told how I'm holding this wrong 🤣
WARNING assert(): assert($product->$salt === 42) failed in foo.php on line 58.
WARNING assert(): assert(Craft::$app->getElements()->getElementById($product->id, Product::class)->$salt === 42) failed in foo.php on line 59.
Craft CMS version
3.8.16
Craft Commerce version
3.4.22.1
PHP version
7.4.33
Operating system and version
macOS 13.4.1
Database type and version
mysql 8.0.34
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered:
What happened?
Description
I am unable to programmatically create a custom field, and subsequently assign it to a
Product
. It works forUser
, and forOrder
, but not forProduct
. I suspect it's related toProduct
delegating toProductType
for its field layout under certain circumstances, but I can't work it out. I'd be happy to be told how I'm holding this wrong 🤣Cross post
Steps to reproduce
From a fresh install of Craft + Commerce, under
php craft shell
,require('foo.php');
wherefoo.php
is:Expected behavior
All assertions to pass.
Actual behavior
Craft CMS version
3.8.16
Craft Commerce version
3.4.22.1
PHP version
7.4.33
Operating system and version
macOS 13.4.1
Database type and version
mysql 8.0.34
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered: