-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strings are not stripped when importing properties #5
Comments
As it happens, a helper has been added to the file propertymanager.py which is supposed to strip blanks of property values during imports, as is clear from comments in _getNodeText():
However, this method only strips tag values if the tag is a "text" tag. We need them to strip PROPERTY tags too. This patch (applicable to v. 0.5) will make import work:
The changes are in the function _initProperties. They might indeed cause problems for multiline values. There may be a more elegant solution. |
Hi @agger-magenta Thanks for the patch. Do you have a test case and/or some test data? |
Unfortunately not, as it seems the export from Plone 3 is stranded on my old laptop, which broke. However, it's very easy to reproduce with any property that has a structure as described in the ticket. I.e., with the newlines, like
'The document now gets the "layout" property '\n forf_forside_view\n' - which gives us a 404 when trying to view the document.' |
I'm importing a Plone site from Plone 3, where several documents and directories have the "layout" property set to direct them to a custom view.
I'm importing in Plone 4 with quintagroup.transmogrifier v. 0.5.
The properties file for one of the documents looks, e.g., like this:
The document now gets the "layout" property '\n forf_forside_view\n' - which gives us a 404 when trying to view the document, as no view with this name exists.
If the transmogrifier's default export phase insist on formatting the XML with line breaks, I'd expect its import phase to strip the strings before feeding them into the Zope database.
The text was updated successfully, but these errors were encountered: