[Compat Data] Unable to set order of feature.children

RESOLVED FIXED

Status

RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: jwhitlock, Unassigned)

Tracking

({in-triage})

Details

(Whiteboard: [specification][type:bug])

(Reporter)

Description

3 years ago
What did you do?
================
1. Attempt to PATCH the order of feature.children on Web/CSS/background (https://browsercompat.herokuapp.com/view_feature/655)

What happened?
==============
The order of child elements did not change

What should have happened?
==========================
The order should have reflected the POST order

Is there anything else we should know?
======================================
I was able, through trial and error, to get the order correct, but it required several steps and directly calling MPTT ordering functions from an interactive shell.

There appears to be a bug in the django-mptt library [1] around re-ordering sibling elements.

[1] https://github.com/django-mptt/django-mptt
(Reporter)

Updated

3 years ago
Blocks: 996570
Keywords: in-triage
Commits pushed to master at https://github.com/mdn/browsercompat

https://github.com/mdn/browsercompat/commit/af52794a5a19e490b669b6fa6b921d37658ad319
fix bug 1224341 - Fix Feature.set_children_order

In some cases (such as swapping each child pairs) it is necessary to
reload both the previous and the next child from the database, so that
the MPTT metadata is correct for the move.

https://github.com/mdn/browsercompat/commit/52e0a22d1bde47090ad3901c6db9b763d31934ca
Merge pull request #82 from mdn/fix_set_child_order_1224341

fix bug 1224341 - Fix Feature.set_children_order

r=groovecoder

Updated

3 years ago
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Is this issue related to 1159344?
Flags: needinfo?(jwhitlock)
No. My bad. Revert a order changeset isn't applying a changeset. Sorry about that!
(Reporter)

Comment 4

3 years ago
:renoirb correct, this is required for bug 1159344 (you have to be able to set the order), but additional work is needed to be able to revert to a historical order.

Also, I was wrong about it being a bug in the django-mptt library.  If you manually and correctly refresh the MPTT data after a move, then future moves will work.  See the commits above for details.
Flags: needinfo?(jwhitlock)
You need to log in before you can comment on or make changes to this bug.