Problem
TaxonsListContentElementRenderer::render() fetches the configured taxons with a bare findBy:
https://github.com/Sylius/CmsPlugin/blob/v1.1.6/src/Renderer/ContentElement/TaxonsListContentElementRenderer.php#L38
$configuration['taxons_list']['taxons'] holds the codes in the order the contributor picked them in the admin form, but findBy(['code' => $codes]) returns rows in database order, so that order is thrown away. And since there is no enabled filter, taxons that were disabled in the catalog keep being rendered by the element while the rest of the shop hides them.
Steps to reproduce
- Create three taxons A, B and C (A created first).
- Add a
taxons_list content element to a page and select the taxons in the order C, A, B.
- Render the page on the shop: the list shows A, B, C (database order), not C, A, B.
- Disable B in the catalog and reload the page: B is still rendered.
Expected behaviour
The element renders the taxons in the order they were selected in the admin, and skips disabled taxons, consistently with how the shop treats disabled taxons everywhere else. This is the same family of problem as #119, which covers disabled products in the products grid/carousel elements.
Problem
TaxonsListContentElementRenderer::render()fetches the configured taxons with a barefindBy:https://github.com/Sylius/CmsPlugin/blob/v1.1.6/src/Renderer/ContentElement/TaxonsListContentElementRenderer.php#L38
$configuration['taxons_list']['taxons']holds the codes in the order the contributor picked them in the admin form, butfindBy(['code' => $codes])returns rows in database order, so that order is thrown away. And since there is noenabledfilter, taxons that were disabled in the catalog keep being rendered by the element while the rest of the shop hides them.Steps to reproduce
taxons_listcontent element to a page and select the taxons in the order C, A, B.Expected behaviour
The element renders the taxons in the order they were selected in the admin, and skips disabled taxons, consistently with how the shop treats disabled taxons everywhere else. This is the same family of problem as #119, which covers disabled products in the products grid/carousel elements.