diff --git a/Products/CMFPlone/__init__.py b/Products/CMFPlone/__init__.py index 0cd0969e63..ff52822e9e 100644 --- a/Products/CMFPlone/__init__.py +++ b/Products/CMFPlone/__init__.py @@ -9,9 +9,16 @@ __version__ = pkg_resources.require("Products.CMFPlone")[0].version -if __version__ < '7': +if __version__ < "7": + # This sets SKIP_PTA to skip the check for + # Publication through acquisition in Plone 6. + # Please remove this code block when can. + import Products.CMFCore.explicitacquisition from Products.CMFCore.explicitacquisition import PTA_ENV_KEY - os.environ[PTA_ENV_KEY] = os.environ.get(PTA_ENV_KEY, 'false') + + os.environ[PTA_ENV_KEY] = os.environ.get(PTA_ENV_KEY, "false") + # Importing (from) the module sets SKIP_PTA. We need to override that too. + Products.CMFCore.explicitacquisition.SKIP_PTA = os.environ[PTA_ENV_KEY] == "false" cmfplone_globals = globals() this_module = sys.modules[__name__] diff --git a/news/3872.bugfix b/news/3872.bugfix new file mode 100644 index 0000000000..69f0eb3eb6 --- /dev/null +++ b/news/3872.bugfix @@ -0,0 +1,3 @@ +Actually disable explicit acquisition in Plone 6.0 +Same as on Plone 6.1. +[gotcha]