diff --git a/last_commit.txt b/last_commit.txt index dec06efa1a..edd3bf83dc 100644 --- a/last_commit.txt +++ b/last_commit.txt @@ -1,38 +1,37 @@ -Repository: plone.app.discussion +Repository: Products.CMFPlone -Branch: refs/heads/main -Date: 2024-08-05T20:33:09Z -Author: pre-commit-ci[bot] (pre-commit-ci[bot]) <66853113+pre-commit-ci[bot]@users.noreply.github.com> -Commit: https://github.com/plone/plone.app.discussion/commit/08fab0fcf256c9b9c7e977d12ca89ec1fb699798 +Branch: refs/heads/master +Date: 2024-08-14T17:28:47+02:00 +Author: Maurits van Rees (mauritsvanrees) +Commit: https://github.com/plone/Products.CMFPlone/commit/f68fb6c3673e8a17b36e50924db55e28639760ba -[pre-commit.ci] pre-commit autoupdate +Use Products.isurlinportal directly, instead of relying on it patching our URLTool. -updates: -- [github.com/asottile/pyupgrade: v3.16.0 → v3.17.0](https://github.com/asottile/pyupgrade/compare/v3.16.0...v3.17.0) -- [github.com/psf/black: 24.4.2 → 24.8.0](https://github.com/psf/black/compare/24.4.2...24.8.0) -- [github.com/PyCQA/flake8: 7.1.0 → 7.1.1](https://github.com/PyCQA/flake8/compare/7.1.0...7.1.1) -- [github.com/collective/i18ndude: 6.2.0 → 6.2.1](https://github.com/collective/i18ndude/compare/6.2.0...6.2.1) +This solves a cyclic dependency. +See https://github.com/plone/Products.isurlinportal/issues/12 Files changed: -M .pre-commit-config.yaml +A news/12.breaking +M Products/CMFPlone/URLTool.py -b'diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml\nindex 3479cc26..14603265 100644\n--- a/.pre-commit-config.yaml\n+++ b/.pre-commit-config.yaml\n@@ -7,7 +7,7 @@ ci:\n \n repos:\n - repo: https://github.com/asottile/pyupgrade\n- rev: v3.16.0\n+ rev: v3.17.0\n hooks:\n - id: pyupgrade\n args: [--py38-plus]\n@@ -16,7 +16,7 @@ repos:\n hooks:\n - id: isort\n - repo: https://github.com/psf/black\n- rev: 24.4.2\n+ rev: 24.8.0\n hooks:\n - id: black\n - repo: https://github.com/collective/zpretty\n@@ -32,7 +32,7 @@ repos:\n # """\n ##\n - repo: https://github.com/PyCQA/flake8\n- rev: 7.1.0\n+ rev: 7.1.1\n hooks:\n - id: flake8\n \n@@ -71,7 +71,7 @@ repos:\n - id: check-python-versions\n args: [\'--only\', \'setup.py,pyproject.toml\']\n - repo: https://github.com/collective/i18ndude\n- rev: "6.2.0"\n+ rev: "6.2.1"\n hooks:\n - id: i18ndude\n \n' +b'diff --git a/Products/CMFPlone/URLTool.py b/Products/CMFPlone/URLTool.py\nindex 76ccbb2f39..71aecab897 100644\n--- a/Products/CMFPlone/URLTool.py\n+++ b/Products/CMFPlone/URLTool.py\n@@ -6,6 +6,7 @@\n from Products.CMFCore.URLTool import URLTool as BaseTool\n from Products.CMFPlone.patches.gtbn import rewrap_in_request_container\n from Products.CMFPlone.PloneBaseTool import PloneBaseTool\n+from Products.isurlinportal import isURLInPortal\n from zope.component import getUtility\n \n \n@@ -14,26 +15,10 @@ class URLTool(PloneBaseTool, BaseTool):\n security = ClassSecurityInfo()\n toolicon = "skins/plone_images/link_icon.png"\n \n- @security.public\n- def isURLInPortal(self, url, context=None):\n- # Note: no docstring, because the method is publicly available\n- # but does not need to be callable on site-url/portal_url/isURLInPortal.\n- #\n- # This method is overridden by Products.isurlinportal,\n- # but the public declaration still seems needed.\n- #\n- # Also, in tests/testURLTool.py we do not use layers,\n- # which means the Products code is not loaded,\n- # so we need to import it explicitly.\n- # This is done once.\n- try:\n- from Products.isurlinportal import isURLInPortal\n- except ImportError:\n- # If this somehow fails, it seems better to have a safe fallback,\n- # instead of a hard failure.\n- return False\n-\n- return isURLInPortal(self, url, context=context)\n+ # The implementation of this method was moved to Products.isurlinportal\n+ # to be able to more quickly do a security release in case there is a\n+ # problem in this part.\n+ isURLInPortal = isURLInPortal\n \n def getPortalObject(self):\n portal = aq_parent(aq_inner(self))\ndiff --git a/news/12.breaking b/news/12.breaking\nnew file mode 100644\nindex 0000000000..af580c5b43\n--- /dev/null\n+++ b/news/12.breaking\n@@ -0,0 +1,3 @@\n+Use `Products.isurlinportal` directly, instead of relying on it patching our `URLTool`.\n+This solves a cyclic dependency.\n+[maurits]\n' -Repository: plone.app.discussion +Repository: Products.CMFPlone -Branch: refs/heads/main -Date: 2024-08-13T18:44:52+02:00 +Branch: refs/heads/master +Date: 2024-08-17T01:45:35+02:00 Author: Maurits van Rees (mauritsvanrees) -Commit: https://github.com/plone/plone.app.discussion/commit/2c9aefe76e9a928a213294d368f5c28777ca9981 +Commit: https://github.com/plone/Products.CMFPlone/commit/f51422ece69e463b393c714cac57ae3d59585f61 -Merge pull request #243 from plone/pre-commit-ci-update-config +Merge pull request #4000 from plone/maurits-use-products-isurlinportal-directly -[pre-commit.ci] pre-commit autoupdate +Use Products.isurlinportal directly Files changed: -M .pre-commit-config.yaml +A news/12.breaking +M Products/CMFPlone/URLTool.py -b'diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml\nindex 3479cc26..14603265 100644\n--- a/.pre-commit-config.yaml\n+++ b/.pre-commit-config.yaml\n@@ -7,7 +7,7 @@ ci:\n \n repos:\n - repo: https://github.com/asottile/pyupgrade\n- rev: v3.16.0\n+ rev: v3.17.0\n hooks:\n - id: pyupgrade\n args: [--py38-plus]\n@@ -16,7 +16,7 @@ repos:\n hooks:\n - id: isort\n - repo: https://github.com/psf/black\n- rev: 24.4.2\n+ rev: 24.8.0\n hooks:\n - id: black\n - repo: https://github.com/collective/zpretty\n@@ -32,7 +32,7 @@ repos:\n # """\n ##\n - repo: https://github.com/PyCQA/flake8\n- rev: 7.1.0\n+ rev: 7.1.1\n hooks:\n - id: flake8\n \n@@ -71,7 +71,7 @@ repos:\n - id: check-python-versions\n args: [\'--only\', \'setup.py,pyproject.toml\']\n - repo: https://github.com/collective/i18ndude\n- rev: "6.2.0"\n+ rev: "6.2.1"\n hooks:\n - id: i18ndude\n \n' +b'diff --git a/Products/CMFPlone/URLTool.py b/Products/CMFPlone/URLTool.py\nindex 76ccbb2f39..71aecab897 100644\n--- a/Products/CMFPlone/URLTool.py\n+++ b/Products/CMFPlone/URLTool.py\n@@ -6,6 +6,7 @@\n from Products.CMFCore.URLTool import URLTool as BaseTool\n from Products.CMFPlone.patches.gtbn import rewrap_in_request_container\n from Products.CMFPlone.PloneBaseTool import PloneBaseTool\n+from Products.isurlinportal import isURLInPortal\n from zope.component import getUtility\n \n \n@@ -14,26 +15,10 @@ class URLTool(PloneBaseTool, BaseTool):\n security = ClassSecurityInfo()\n toolicon = "skins/plone_images/link_icon.png"\n \n- @security.public\n- def isURLInPortal(self, url, context=None):\n- # Note: no docstring, because the method is publicly available\n- # but does not need to be callable on site-url/portal_url/isURLInPortal.\n- #\n- # This method is overridden by Products.isurlinportal,\n- # but the public declaration still seems needed.\n- #\n- # Also, in tests/testURLTool.py we do not use layers,\n- # which means the Products code is not loaded,\n- # so we need to import it explicitly.\n- # This is done once.\n- try:\n- from Products.isurlinportal import isURLInPortal\n- except ImportError:\n- # If this somehow fails, it seems better to have a safe fallback,\n- # instead of a hard failure.\n- return False\n-\n- return isURLInPortal(self, url, context=context)\n+ # The implementation of this method was moved to Products.isurlinportal\n+ # to be able to more quickly do a security release in case there is a\n+ # problem in this part.\n+ isURLInPortal = isURLInPortal\n \n def getPortalObject(self):\n portal = aq_parent(aq_inner(self))\ndiff --git a/news/12.breaking b/news/12.breaking\nnew file mode 100644\nindex 0000000000..af580c5b43\n--- /dev/null\n+++ b/news/12.breaking\n@@ -0,0 +1,3 @@\n+Use `Products.isurlinportal` directly, instead of relying on it patching our `URLTool`.\n+This solves a cyclic dependency.\n+[maurits]\n'