Closed Bug 1224341 Opened 9 years ago Closed 9 years ago

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

Categories

(developer.mozilla.org Graveyard :: General, defect)

All
Other
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jwhitlock, Unassigned)

References

Details

(Keywords: in-triage, Whiteboard: [specification][type:bug])

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
Blocks: 996570
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
Status: NEW → RESOLVED
Closed: 9 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!
: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)
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.