From 8a4e49005a72615c406efcd0359dbc6b68a7a191 Mon Sep 17 00:00:00 2001 From: Christian Meier Date: Wed, 4 Oct 2023 20:56:07 +0200 Subject: [PATCH] Add ZODBMountPoint temp_folder if available Refs https://github.com/zms-publishing/ZMS/pull/187/files/3c3427b922957e52a156d46c6dcf8e68ec39a8d0#r1341343451 --- Products/zms/__init__.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Products/zms/__init__.py b/Products/zms/__init__.py index 386ca3718..94533f75e 100644 --- a/Products/zms/__init__.py +++ b/Products/zms/__init__.py @@ -349,11 +349,15 @@ def create_session_storage_if_neccessary(context): app = context.getApplication() if not 'temp_folder' in app: - # Adding a 'folder' is a just fallback - # if a 'mount_point' is not available - # like usually configured via zope.conf - temp_folder = Folder('temp_folder') - app._setObject('temp_folder', temp_folder) + try: + from Products.ZODBMountPoint.MountedObject import manage_addMounts + manage_addMounts(app, paths=('/temp_folder',)) + except: + # Adding a 'folder' is a just fallback + # if a 'mount_point' is not available + # like usually configured via zope.conf + temp_folder = Folder('temp_folder') + app._setObject('temp_folder', temp_folder) if not 'session_data' in app.temp_folder: container = TransientObjectContainer( 'session_data',