Skip to content
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

Customer option File resume to "This value is not valid" #114

Closed
Loocos opened this issue Aug 12, 2022 · 3 comments
Closed

Customer option File resume to "This value is not valid" #114

Loocos opened this issue Aug 12, 2022 · 3 comments

Comments

@Loocos
Copy link
Contributor

Loocos commented Aug 12, 2022

Hi there,

I'm wondering if you guys have also the same error when adding a product to cart with customer option (File type) with Sylius >= v1.10
it say a form error : The value is not valid.

I was able to fix it by replacing this line in Form\product_theme.html.twig :
<input type="hidden" name="{{full_name ~ '[data]' }}" id="{{ id ~ '_data'}}" />
To
<input type="hidden" name="{{full_name }}" id="{{ id ~ '_data'}}" />

If yes, I will do a PR to fix it.
Thanks for your feedback :)

@mamazu
Copy link
Collaborator

mamazu commented Aug 16, 2022

That's a good question. Currently we are only using this plugin in a headless mode but one of our developers can have a look at it. @JakobTolkemit

@jeromin
Copy link
Contributor

jeromin commented Mar 6, 2023

Hi and thanks @Loocos for the tips but did you figured it out when the file option is mean to be required ?

Symfony Form absolutely wants to validate the file input (The value is not valid) as it is an array [ data => imgFile... ])
whereas CustomOptionPlugin validates the requirement (brille24.form.customer_options.required) but it is incompatible with setting the same input name.

@mamazu
Copy link
Collaborator

mamazu commented Mar 10, 2023

I think I found the issue. Could you check the pull request #128 ? This should fix the validation for files.

@mamazu mamazu closed this as completed Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants