Skip to content
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

Fix Site Properties Generic Setup Export Step #1469

Merged
merged 4 commits into from
Nov 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Changelog

**Fixed**

- #1469 Fix Site Properties Generic Setup Export Step
- #1467 Cannot override behavior of Batch folder when using `before_render`


Expand Down
7 changes: 6 additions & 1 deletion bika/lims/exportimport/genericsetup/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
i18n_domain="senaite.core">

<!-- XML Import/Export Adapters -->
<adapter factory=".structure.SenaiteSiteXMLAdapter"/>

<!-- N.B. Deactivated by purpose!
Avoid its usage when the site properties get exported:
Products.CMFCore.exportimport.properties.exportSiteProperties
<adapter factory=".structure.SenaiteSiteXMLAdapter"/>
-->
<adapter factory=".structure.ContentXMLAdapter"/>

<!-- Field Adapters
Expand Down
8 changes: 7 additions & 1 deletion bika/lims/exportimport/genericsetup/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,13 @@ def exportObjects(obj, parent_path, context):
logger.info("Skipping {}".format(repr(obj)))
return

exporter = queryMultiAdapter((obj, context), IBody)
if api.is_portal(obj):
# explicitly instantiate the exporter to avoid adapter clash of
# Products.CMFCore.exportimport.properties.PropertiesXMLAdapter
exporter = SenaiteSiteXMLAdapter(obj, context)
else:
exporter = queryMultiAdapter((obj, context), IBody)

path = "%s%s" % (parent_path, get_id(obj))
if exporter:
if exporter.name:
Expand Down
5 changes: 5 additions & 0 deletions bika/lims/upgrade/v01_03_003.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,10 @@ def upgrade(tool):

logger.info("Upgrading {0}: {1} -> {2}".format(product, ver_from, version))

# -------- ADD YOUR STUFF BELOW --------

# https://github.com/senaite/senaite.core/pull/1469
setup.runImportStepFromProfile(profile, "propertiestool")

logger.info("{0} upgraded to version {1}".format(product, version))
return True