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
In our current project, we have item language exported from Plone 4.3.20 as "language": "en" and if the target Plone Site doesn't allow en we get the deserialization error. otherwise it gets imported correctly.
I have this in custom code, which fixes the problem for my case (export example content from English site, import it in Spanish site):
class CustomImportContent(ImportContent):
def global_dict_hook(self, item):
# When we export English content and import it in the Spanish site,
# we must change the langue to Spanish, otherwise you get an error:
# zExceptions.BadRequest: [{'message': 'Constraint not satisfied',
# 'field': 'language', 'error': 'ValidationError'}]
# BTW, the value is for example:
# {'title': 'Nederlands', 'token': 'nl'}
# Hey, wouldn't the easiest be to drop the key? Seems to work fine.
# Alternatively, use self.context.Language(), so a language is really set.
# This might be better for multilingual sites.
language = item.pop("language", None)
if language is not None:
logger.info("Popped language %s from item.", language)
return item
I have a Plone 5.2 AT site that exports most of the content with
and some content items as
This leads to import errors such as
The text was updated successfully, but these errors were encountered: