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

Removing taxon used in promotion breaks the promotion edit page #10225

Closed
stefandoorn opened this issue Mar 13, 2019 · 4 comments
Closed

Removing taxon used in promotion breaks the promotion edit page #10225

stefandoorn opened this issue Mar 13, 2019 · 4 comments
Labels
Potential Bug Potential bugs or bugfixes, that needs to be reproduced.

Comments

@stefandoorn
Copy link
Contributor

Sylius version affected: 1.2.x

Description
It seems that admin user is able to delete a taxon that is used in the rules on a promotion. Deleting the taxon makes the promotion edit page unusable:

Uncaught PHP Exception Symfony\Component\Form\Exception\TransformationFailedException: "Unable to transform value for property path "[taxon]": Object "AppBundle\Entity\Taxon" with identifier "code"="identifier-code-here" does not exist." at /app/vendor/symfony/symfony/src/Symfony/Component/Form/Form.php line 1048

Probably best that the taxon cannot be used, or the promotion stays accessible. Anyhow the admin needs to know this is happening, as it might lead to unexpected results.

@Zales0123 Zales0123 added the Potential Bug Potential bugs or bugfixes, that needs to be reproduced. label Mar 13, 2019
@pamil pamil added the Roadmap label Mar 19, 2019
@gabiudrescu
Copy link
Contributor

on our website this broke our checkout process. we did a fix that caught such exceptions and removed non-existing taxons from promotion rules.

@GSadee
Copy link
Member

GSadee commented May 6, 2019

I've tried to reproduce this issue on Sylius 1.3, but without a result. Could you deliver a failing scenario for this bug?

@gabiudrescu
Copy link
Contributor

Steps to reproduce:

  • create a taxon
  • assign some products to that taxon (optionally)
  • create a promotion that uses that taxon in a rule (eg: contains products from taxon) and successfully save it
  • delete the taxon
  • go to the promotion show page

what happens:

  • you see a 500 error
  • this happens because when the rule is rendered in the show page, it will try to fetch from the taxon repository a non existing taxon

@GSadee
Copy link
Member

GSadee commented May 6, 2019

I've reproduced all of these steps, but I've used the rule Has at least one from taxons that does not cause an error, the problem is with Total price of items from taxon rule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Potential Bug Potential bugs or bugfixes, that needs to be reproduced.
Projects
None yet
Development

No branches or pull requests

5 participants