Sylius: Updating taxon position not work properly

Created on 8 Nov 2018  路  13Comments  路  Source: Sylius/Sylius

Sylius version affected: 1.3.3

Description
Using leaf nodes up and down not position the taxon correctly

Steps to reproduce
Create taxons and use the leaf nodes.

Possible Solution
Not investigated yet.

captura de pantalla de 2018-11-08 14-54-22

Admin Hacktoberfest Potential Bug UX

Most helpful comment

This issue is on 1.6.0 as well.
It should not be possible to move Men up, and obviously seeing it going down is not expected :p.

moveup

All 13 comments

Thank you for the bug report! We'll investigate more into that, it would be a great help if anyone would like to try to solve this one.

I think it's because the position field for the taxon is not set properly. When you want to move the leaf nodes it just increment or decrement the position 1 by 1. But sometimes you can have taxon position like this one:

- taxon_1 (parent_id NULL, position 12)
--- taxon_1.1 (parent_id taxon_1, position 2)
--  taxon_1.2 (parent_id taxon_1, position 3)
--  taxon_1.3 (parent_id taxon_1, position 8)

So if you push the up arrow for the taxon_1.3 the position will be decremented by 1 and it will be = position 7. But it's not enough for it to go above the taxon_1.2.

I hope it's clear enough to help you.

Hi @smashou. Thanks for your reply.
In the example of Sylius demo, when i do click in arrow up in Books taxon, this move it to bottom of the list. so, i think don't work properly as you says. Maybe the position of taxons in Sylius is wrong too?

Hi,

I have exactly the same issue on 1.3.5 / 1.3.6 / 1.3.7 version of Sylius.

Hello, One month after, there is news of this issue? thks

This issue is on 1.6.0 as well.
It should not be possible to move Men up, and obviously seeing it going down is not expected :p.

moveup

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.

Do not stale?

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.

Do not stale

The solution:

  • Create sylius_admin_ajax_taxon_move_up and sylius_admin_ajax_taxon_move_down actions rather than sylius_admin_ajax_taxon_move
  • We shouldn't send position as that an break things, so taxonMoveUp / taxonMoveDown / TaxonPositionType should be removed
  • sylius_admin_ajax_taxon_move_up should switch positions between current taxon and taxon with max position (but less than current taxon's position) with same parent as current taxon
  • sylius_admin_ajax_taxon_move_down should switch positions between current taxon and taxon with min position (but greater than current taxon's position) with same parent as current taxon

@pamil , could you take a look into #11905 please?

@AdamKasp , this issue seems like fixed by #11905

Was this page helpful?
0 / 5 - 0 ratings

Related issues

loic425 picture loic425  路  3Comments

bnd170 picture bnd170  路  3Comments

crbelaus picture crbelaus  路  3Comments

Chrysweel picture Chrysweel  路  3Comments

igormukhingmailcom picture igormukhingmailcom  路  3Comments