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

Do not make product variant's fields empty while editing simple product #7764

Merged
merged 2 commits into from Mar 22, 2017

Conversation

pamil
Copy link
Contributor

@pamil pamil commented Mar 15, 2017

Q A
Bug fix? yes
New feature? no
BC breaks? no
Related tickets fixes #7735
License MIT

TODO:

  • Regression tests (null set to product variant's name after saving simple product)

@pamil pamil force-pushed the missing-product-variant-variables branch from a08960a to 2e9a809 Compare March 15, 2017 11:07
<div class="ui segment">
<h4 class="ui dividing header">{{ 'sylius.ui.availability'|trans }}</h4>
{{ form_row(form.variant.availableOn) }}
{{ form_row(form.variant.availableUntil) }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should only be shown on simple products

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is, see line 41 :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, i see, sorry

@plozmun
Copy link
Contributor

plozmun commented Mar 15, 2017

To prevent setting name to null on save, yo can add
$form->get('variant')->remove('name');
at this line
https://github.com/Sylius/Sylius/blob/master/src/Sylius/Bundle/ProductBundle/Form/EventSubscriber/SimpleProductSubscriber.php#L51-L56

@pamil pamil closed this Mar 15, 2017
@pamil pamil reopened this Mar 15, 2017
@pjedrzejewski pjedrzejewski added this to the v1.0.0-beta.2 milestone Mar 15, 2017
@pamil pamil force-pushed the missing-product-variant-variables branch from 2e9a809 to 01bfdb0 Compare March 21, 2017 12:56
@pamil pamil force-pushed the missing-product-variant-variables branch from 01bfdb0 to 203562c Compare March 21, 2017 13:03
@pamil pamil force-pushed the missing-product-variant-variables branch from 203562c to f810724 Compare March 21, 2017 14:02
@pamil pamil closed this Mar 21, 2017
@pamil pamil reopened this Mar 21, 2017
@pjedrzejewski pjedrzejewski merged commit 9702288 into Sylius:master Mar 22, 2017
@pjedrzejewski
Copy link
Member

Thanks Kamil! 👍 👍 👍

@pamil pamil deleted the missing-product-variant-variables branch March 22, 2017 08:58
pamil pushed a commit to pamil/Sylius that referenced this pull request May 7, 2019
…iables

Do not make product variant's fields empty while editing simple product
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Variant name lost when editing the product
3 participants