I am getting a File is not valid error when I try to import some plugins.
By inspecting with a debugger, I have pinned down the issue to the presence of the plugin_type field within the data dictionary of a plugin. To be more clear, here is a json example of a problematic plugin:
The existence of the plugin_type field within the data dictionary confuses the _object_version_data_hook function, which tries to instantiate an ArchivedPlugin, but fails because of the existence of unknown parameters such as path. Indeed, I could implement a simple fix by patching the _object_version_data_hook to return right away the data dictionary untouched if it doesn't contain the pk key.
Obviously this fix is not sustainable, and it would be better to understand why the plugin_type key is duplicated in the first place. An important hint that I discovered is that this problem seems to only happen with plugins that don't have an associated model in the database.
I am using Django 2.2, django-cms 3.7.4 and djangocms-transfer 1.0.0
Hello,
I am getting a
File is not valid
error when I try to import some plugins.By inspecting with a debugger, I have pinned down the issue to the presence of the
plugin_type
field within thedata
dictionary of a plugin. To be more clear, here is a json example of a problematic plugin:The existence of the
plugin_type
field within thedata
dictionary confuses the_object_version_data_hook
function, which tries to instantiate anArchivedPlugin
, but fails because of the existence of unknown parameters such aspath
. Indeed, I could implement a simple fix by patching the_object_version_data_hook
to return right away thedata
dictionary untouched if it doesn't contain thepk
key.Obviously this fix is not sustainable, and it would be better to understand why the
plugin_type
key is duplicated in the first place. An important hint that I discovered is that this problem seems to only happen with plugins that don't have an associated model in the database.I am using Django 2.2, django-cms 3.7.4 and djangocms-transfer 1.0.0
Thank you!