From dc684fc4ede026c7e6ed11bf6e8b88f2693aad64 Mon Sep 17 00:00:00 2001 From: Philip Bauer Date: Thu, 19 Sep 2024 14:00:45 +0200 Subject: [PATCH 1/4] Fix creating a fresh site in Plone 6.1 when registry does not exist yet. Fixes #378 --- CHANGES.rst | 3 +-- src/collective/solr/utils.py | 7 +++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index a29c25bf..a3062d5c 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,8 +4,7 @@ Changelog 9.3.1 (unreleased) ------------------ -- Nothing changed yet. - +- Fix creating a fresh site in Plone 6.1 when registry does not exist yet. Fixes #378 [pbauer] 9.3.0 (2024-02-15) ------------------ diff --git a/src/collective/solr/utils.py b/src/collective/solr/utils.py index 2ea1c345..ec72e6da 100644 --- a/src/collective/solr/utils.py +++ b/src/collective/solr/utils.py @@ -7,6 +7,7 @@ from six.moves import range from unidecode import unidecode from zope.component import getUtility +from zope.component import queryUtility if hasattr(str, "maketrans"): maketrans = str.maketrans @@ -22,7 +23,9 @@ def getConfig(): def isActive(): """indicate if the solr connection should/can be used""" try: - registry = getUtility(IRegistry) + registry = queryUtility(IRegistry) + if not registry: + return False active = registry["collective.solr.active"] except KeyError: return False @@ -132,7 +135,7 @@ def isSimpleSearch(term): new_parts.append(parts[i]) else: new_parts.append("quoted") - term = u"".join(new_parts) + term = "".join(new_parts) if bool(operators.match(term)): return False if bool(simpleCharacters.match(term)): From 3f7dd2111d28dd78c949928d29c8cd220709f546 Mon Sep 17 00:00:00 2001 From: David Glick Date: Thu, 19 Sep 2024 07:14:55 -0700 Subject: [PATCH 2/4] Update src/collective/solr/utils.py --- src/collective/solr/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/collective/solr/utils.py b/src/collective/solr/utils.py index ec72e6da..ed0c02e5 100644 --- a/src/collective/solr/utils.py +++ b/src/collective/solr/utils.py @@ -24,7 +24,7 @@ def isActive(): """indicate if the solr connection should/can be used""" try: registry = queryUtility(IRegistry) - if not registry: + if registry is None: return False active = registry["collective.solr.active"] except KeyError: From d37984be4408ea718f2a02676b3b9bc14caa3d58 Mon Sep 17 00:00:00 2001 From: David Glick Date: Sat, 21 Sep 2024 10:31:06 -0700 Subject: [PATCH 3/4] Test against Plone 6.0.9 --- plone-6.0.x.cfg | 2 +- requirements-6.0.x.txt | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plone-6.0.x.cfg b/plone-6.0.x.cfg index 6e0f5510..44997f4b 100644 --- a/plone-6.0.x.cfg +++ b/plone-6.0.x.cfg @@ -1,6 +1,6 @@ [buildout] extends = - https://dist.plone.org/release/6.0.0/versions.cfg + https://dist.plone.org/release/6.0.9/versions.cfg base.cfg versions = versions diff --git a/requirements-6.0.x.txt b/requirements-6.0.x.txt index cb49b770..0ef1af7d 100644 --- a/requirements-6.0.x.txt +++ b/requirements-6.0.x.txt @@ -1,7 +1,7 @@ -# https://dist.plone.org/release/6.0.0/requirements.txt -pip==22.3.1 -setuptools==65.5.1 -wheel==0.38.4 +# https://dist.plone.org/release/6.0.9/requirements.txt +pip==23.3.1 +setuptools==69.0.2 +wheel==0.42.0 zc.buildout==3.0.1 # Windows specific down here (has to be installed here, fails in buildout) @@ -9,4 +9,4 @@ zc.buildout==3.0.1 pywin32 ; platform_system == 'Windows' # SSL Certs on windows, because Python is missing them otherwise: -certifi ; platform_system == 'Windows' \ No newline at end of file +certifi ; platform_system == 'Windows' From dc3c7fc3c08acd57b5d29bcf4c285925647bf469 Mon Sep 17 00:00:00 2001 From: David Glick Date: Sat, 21 Sep 2024 10:40:46 -0700 Subject: [PATCH 4/4] pin readme-renderer to docutils 0.18 compatible version --- plone-6.0.x.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/plone-6.0.x.cfg b/plone-6.0.x.cfg index 44997f4b..825f1e21 100644 --- a/plone-6.0.x.cfg +++ b/plone-6.0.x.cfg @@ -12,3 +12,4 @@ zodb-temporary-storage = off black = 21.7b0 importlib-metadata = 4.12.0 Pygments = 2.14.0 +readme-renderer = 43.0 \ No newline at end of file