diff --git a/CHANGES.rst b/CHANGES.rst index 663b6f9b..ad8a5937 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -7,6 +7,8 @@ Changelog - Don't re-use `mapping` variable when migrating portlet data. [witsch] +- Fix editing revision author - refs #216 + [avoinea] - Better support for portal import which avoids parsing JSON twice. [gotcha] diff --git a/src/collective/exportimport/export_content.py b/src/collective/exportimport/export_content.py index 060c1c05..0c9135b3 100644 --- a/src/collective/exportimport/export_content.py +++ b/src/collective/exportimport/export_content.py @@ -537,8 +537,12 @@ def export_revisions(self, item, obj): comment = history_metadata.retrieve(version_id)["metadata"]["sys_metadata"]["comment"] if comment and comment != item["exportimport.versions"][version_id].get("changeNote"): item["exportimport.versions"][version_id]["changeNote"] = comment + principal = history_metadata.retrieve(version_id)["metadata"]["sys_metadata"]["principal"] + if principal and principal != item["exportimport.versions"][version_id].get("changeActor"): + item["exportimport.versions"][version_id]["changeActor"] = principal # current changenote item["changeNote"] = history_metadata.retrieve(-1)["metadata"]["sys_metadata"]["comment"] + item["changeActor"] = history_metadata.retrieve(-1)["metadata"]["sys_metadata"]["principal"] return item diff --git a/src/collective/exportimport/import_content.py b/src/collective/exportimport/import_content.py index dd3e332f..d2ce0fc4 100644 --- a/src/collective/exportimport/import_content.py +++ b/src/collective/exportimport/import_content.py @@ -626,6 +626,7 @@ def save_revision(self, obj, item, initial=False): "comment": comment, "timestamp": timestamp, "originator": None, + "principal": item.get("changeActor"), } rt._recursiveSave( obj, app_metadata={}, sys_metadata=sys_metadata, autoapply=True