-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can not create a product attribute fixture of type 'select' #8264
Comments
@pamil Is it possible? :) |
@Keloo which version of Sylius are you using? |
@lchrusciel I'm using beta 1. Thx for the info regarding beta 2 version. 👍 |
Closing then. :) |
Just for the record: in version 1.1.2 (and probably up) working fixture look like this:
|
Hm not sure this is correct. I tried to define them like it's described here but when trying to add the attribute to a product with one or more values, I get an error Looking at how the attribute configuration was inserted, it looks different than a select attribute that was created via the shop backend: The comment above produces:
Creating one in the backend produces:
So the difference is the array index for each choice (which explains the form error message on the input) which needs to be a string code. Creating them like the following works:
That was at least my experience, maybe I'm missing something here. The fixture doesn't seem to throw any errors, no matter how you enter the configuration. Any thoughts on this @pamil @lchrusciel since you "👍" the comment? |
I also used the trick FYI I had to add also
In order to avoid this error :
|
@venyii I've just return to the project based on Sylius. After update to 1.2.5 "mine" method was not working any more, but yours is (with addition of suggested by @maximehuran constrains). My first guess was that it has something to do with strict types, but quick glance at code history reveals, that strict type checking and php7.1+ was introduced few months earlier. So honestly, I don't know what have changed since 1.1.2. Anyway, thank you both. Without your comments I would probably burn few hours looking for solution on my own. EDIT: Import and usage is fine, but I it seems that I can't edit AttributeValue created via fixture. Hmm. There's no rest for the wicked I guess :) EDIT2: I guess this one is strongly related to our problem: #9387 |
In the config.yml I have my fixutres. I want to create an product attribute fixture of type 'select'.
I can not find the right definition of it.
I tried like this:
when I try to load the fixutres it says:
[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException] Unrecognized option "configuration" under "product_attribute.custom.canvas_type"
The text was updated successfully, but these errors were encountered: