You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an object is migrated with migrate_base_class_to_new_class, its position in parent folder changes : the object always ends up last. Position should be kept.
The fix in our custom migration code looks like this :
from Acquisition import aq_inner
from Acquisition import aq_parent
from OFS.interfaces import IOrderedContainer
from plone.app.contenttypes.migration import dxmigration
[...]
obj_id = obj.getId()
parent = aq_parent(aq_inner(obj))
position_in_parent = None
ordered = IOrderedContainer(parent, None)
if ordered is not None:
position_in_parent = ordered.getObjectPosition(obj_id)
if dxmigration.migrate_base_class_to_new_class(obj) and position_in_parent is not None:
ordered.moveObject(obj_id, position_in_parent)
[...]
We should add this in the base migration script.
Any feedback on this ?
The text was updated successfully, but these errors were encountered:
When an object is migrated with migrate_base_class_to_new_class, its position in parent folder changes : the object always ends up last. Position should be kept.
plone.app.contenttypes/plone/app/contenttypes/migration/dxmigration.py
Line 162 in 3a7ea8c
The fix in our custom migration code looks like this :
We should add this in the base migration script.
Any feedback on this ?
The text was updated successfully, but these errors were encountered: