As part of a migration to Plone 5.0 we encounter the following misbehaviour:
A standard Plone Folder
>>> doc = app.restrictedTraverse('/share_20171025-144751/hrz')
>>> doc.portal_type
'Folder'
>>> doc.__class__
<class 'plone.app.contenttypes.content.Folder'>
>>> doc.UID
'1eda85a66b1c919616f2ad88649952e2'
has the given UID (which is assigned by the migration process to the created folder in order to retain the original UID (because of existing links in RichText fields).
However this folder is object in portal_catalog with a completely different UID:
We assign the "old" UID like this in our migration script:
folder = plone.api.content.create(...)
folder.UID = old_uid # 1eda85a66b1c919616f2ad88649952e2
folder.reindexObject()
So assigning a new UID does not seem to override the original UID of the freshly created
folder...am I missing something?
-aj