Fix potential bug when publishing Fluent content items
Fix potential bug when publishing Fluent content items

Ensure that the logical ordering of a draft page's
content items is maintained when cloning these
items' relationships to a published copy.

Fix a long-standing but false assumption that the
content items cloned from a draft copy to a
published copy will be returned in the same
order by the `contentitem_set` relationship
queryset on the two copies.

This assumption mostly held true, but could fail
in cases where changes to `Placeholder` objects
associated with a page – especially if a one was
added – happened to cause the placeholder PK
ordering to differ between the draft and published
copy.

When this happened, on publish the code could try
to copy the contents of an M2M field from one type
to a different type that may not have that same
field, causing an `AttributeError`.

Or worse, if the content item types happened to
match despite their ordering being logically
different, the relationships of items in the draft
copy could be mistakenly assigned to different
items in the published copy.

See https://github.com/sfmoma/sfmoma/issues/314

ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit