From 98b7cd7703d30e88898cc4a6acf913910e8822c2 Mon Sep 17 00:00:00 2001 From: Christian Meier Date: Fri, 6 Oct 2023 10:48:52 +0200 Subject: [PATCH] Add ZODBMountPoint temp_folder if available (#194) 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',