Inside a Plone 4.0 AT content-type we have the following sorted ReferenceField
ReferenceField('documents',
keepReferencesOnCopy=1,
required=False,
relationship='useForReiter',
multiValued=True,
allowed_types=('Document', 'ContactInfoReferences'),
widget = ReferenceBrowserWidget(
allow_search = True,
allow_browse = True,
show_indexes = False,
allow_sorting=True,
force_close_on_insert = False,
label = _(u'label_documents', default=u'Documents'),
description = '',
visible = {'edit' : 'visible', 'view' : 'visible' }
)
Now we are migrating to Plone 4.3.3 and we see that after the migration the sorting of the references is completely random.
With some debugging it seems that calling the mutator method is doing something similar.
Example
obj.getDocuments() return:
[<ATDocument at /isesite/en/copy_of_service-units/testlab-solar-thermal-systems-1/further-information>, <ATDocument at /isesite/en/copy_of_service-units/testlab-solar-thermal-systems-1/testlab-solar-thermal-systems>, <ATDocument at /isesite/en/copy_of_service-units/testlab-solar-thermal-systems-1/services>, <ATDocument at /isesite/en/copy_of_service-units/testlab-solar-thermal-systems-1/contacts-1>]
the original object ordering was:
[<ATDocument at /isesite/en/copy_of_service-units/testlab-solar-thermal-systems-1/testlab-solar-thermal-systems>, <ATDocument at /isesite/en/copy_of_service-units/testlab-solar-thermal-systems-1/services>, <ATDocument at /isesite/en/copy_of_service-units/testlab-solar-thermal-systems-1/contacts-1>, <ATDocument at /isesite/en/copy_of_service-units/testlab-solar-thermal-systems-1/further-information>]
We pass the original objects with their ordering to obj.setDocuments() and call
obj.getDocuments() again:
[<ATDocument at /isesite/en/copy_of_service-units/testlab-solar-thermal-systems-1/further-information>, <ATDocument at /isesite/en/copy_of_service-units/testlab-solar-thermal-systems-1/testlab-solar-thermal-systems>, <ATDocument at /isesite/en/copy_of_service-units/testlab-solar-thermal-systems-1/services>, <ATDocument at /isesite/en/copy_of_service-units/testlab-solar-thermal-systems-1/contacts-1>]
So obj.getDocument() returns the same ordering before and after calling obj.setObject()....
Is this a known issue?
-aj