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
In my product_with_variants.yaml blueprint, I have configured a field to import another shared field, so the config looks like this:
(here is a git diff, where on the left I'm importing fields from another fieldset, and the fix to manually config the field on the right):
Here is the resulting error:
[2024-09-30 10:01:43] local.ERROR: Statamic\Fields\Field::__construct(): Argument #2 ($config) must be of type array, string given, called in vendor/duncanmcclean/simple-commerce/src/Fieldtypes/ProductVariantsFieldtype.php on line 38
My solution is to not import fields, which is absolutely fine, but there is likely a Statamic helper to ensure the field is imported and the ProductVariantsFieldtype class is not using it. I haven't spent the time trying to fix this yet, but can look. (Duncan if you have an idea what this could be, just mention it's name, and I could PR a fix).
Steps to reproduce
Edit product blueprint in CP and link to other fields.
Click create product (using that blueprint)
Encounter this error.
Environment
Environment
Application Name: App name
Laravel Version: 11.22.0
PHP Version: 8.3.11
Composer Version: 2.7.7
Environment: local
Debug Mode: ENABLED
URL: appname.test
Maintenance Mode: OFF
Timezone: UTC
Locale: en
Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED
Drivers
Broadcasting: log
Cache: redis
Database: mysql
Logs: stack / single
Mail: smtp
Queue: redis
Session: redis
Simple Commerce
Currencies: GBP
Gateways: Dummy
Repository: Customer: DuncanMcClean\SimpleCommerce\Customers\EntryCustomerRepository
Repository: Order: DuncanMcClean\SimpleCommerce\Orders\EntryOrderRepository
Repository: Product: DuncanMcClean\SimpleCommerce\Products\EntryProductRepository
Shipping Methods: Free Shipping
Tax Engine: DuncanMcClean\SimpleCommerce\Tax\Standard\TaxEngine
Statamic
Addons: 4
Sites: 1
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 5.25.0 PRO
Statamic Addons
duncanmcclean/simple-commerce: 7.5.1
studio1902/statamic-peak-browser-appearance: 3.5.0
studio1902/statamic-peak-seo: 8.16.0
studio1902/statamic-peak-tools: 6.3.2
The text was updated successfully, but these errors were encountered:
Description
In my product_with_variants.yaml blueprint, I have configured a field to import another shared field, so the config looks like this:
(here is a git diff, where on the left I'm importing fields from another fieldset, and the fix to manually config the field on the right):
Here is the resulting error:
[2024-09-30 10:01:43] local.ERROR: Statamic\Fields\Field::__construct(): Argument #2 ($config) must be of type array, string given, called in vendor/duncanmcclean/simple-commerce/src/Fieldtypes/ProductVariantsFieldtype.php on line 38
My solution is to not import fields, which is absolutely fine, but there is likely a Statamic helper to ensure the field is imported and the ProductVariantsFieldtype class is not using it. I haven't spent the time trying to fix this yet, but can look. (Duncan if you have an idea what this could be, just mention it's name, and I could PR a fix).
Steps to reproduce
Environment
The text was updated successfully, but these errors were encountered: