The Wayback Machine - https://web.archive.org/web/20201014072712/https://github.com/Sylius/Sylius/issues/11277
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

Taxon without product isn't removable #11277

Open
jacquesbh opened this issue Mar 23, 2020 · 4 comments · May be fixed by #11682
Open

Taxon without product isn't removable #11277

jacquesbh opened this issue Mar 23, 2020 · 4 comments · May be fixed by #11682

Comments

@jacquesbh
Copy link
Contributor

@jacquesbh jacquesbh commented Mar 23, 2020

Sylius version affected: v1.4.4

Description

Sylius says the category is used and cannot be removed, when we try to remove an empty category.

We figured out that we had some products with the taxon as "Main Taxon".

Steps to reproduce

  1. Add a taxon, keep it empty of products.
  2. Update a product to use the newly created taxon as Main taxon.
  3. Try to remove the taxon.

Possible Solution

I suggest to set to NULL the main_taxon_id column for those products, but this may not be the best solution.

Adding a warning could be a good idea, like "This taxon is used as main taxon for some products.".
But here the issue is "Which products???".

So, maybe a solution could be a warning and a link or a button to "Remove the taxon anyway".

I don't know. The usability of this is quite tricky :/.

@lchrusciel
Copy link
Member

@lchrusciel lchrusciel commented Jun 18, 2020

I can confirm, that the problem still exists. I can see a few possible solutions to this:

  1. As the main taxon is used to generate breadcrumbs only, I would say, that it could be fine to just remove it.
  2. If we will force main taxon to be part of product taxons, then the problem will also disappear, as we can just list related products just by clicking on taxon tree.
  3. Just list all of the related products in a custom error message, with a list of all or some products(I would limit it to let's say ~20 or 100, as the catalog may be pretty big). This can be achieved pretty easily, we have similar logic in TaxonDeletionListener with the removal of menu taxon (where we also do not specify, which channel is related to particular taxon).

The last option is quite an easy pick, if anyone would like to contribute to Sylius and improve our UX a little bit ;)

@jacquesbh
Copy link
Contributor Author

@jacquesbh jacquesbh commented Jun 18, 2020

I would add to the 3rd point: adding a link to unlink all the products from a taxon in the error message :p. But it's a must have ^^

@stale
Copy link

@stale stale bot commented Sep 20, 2020

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale label Sep 20, 2020
@jacquesbh
Copy link
Contributor Author

@jacquesbh jacquesbh commented Sep 20, 2020

Do not stale

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.