From 3d0bb6583cbcacf60ab5eef29ace4c479cbc3dc1 Mon Sep 17 00:00:00 2001 From: davisagli Date: Tue, 15 Oct 2024 22:21:08 -0700 Subject: [PATCH] [fc] Repository: Products.CMFPlone Branch: refs/heads/master Date: 2024-10-15T22:21:08-07:00 Author: Wesley Barroso Lopes (wesleybl) Commit: https://github.com/plone/Products.CMFPlone/commit/9a1a62bb0ed4b208d303748700a5d0a126bd21d2 Avoid POSKeyError when commit occurs and we have savepoint that involves (#4026) Plone Site When ZODB handles savepoint and we have changes in Plone Site at that savepoint, it changes the `_p_estimated_size` attribute of Plone Site. This is an assignment to one of the special persistency attributes (identified by an _p_ name prefix); it should happen without access to any other attributes of obj. But obj._tree is accessed in __setattr__ of PloneSite class and results in a ZODB load which apparently fails. See: https://github.com/plone/plone.restapi/pull/1823#issuecomment-2402855105 Co-authored-by: Rohan Shaw <86848116+rohnsha0@users.noreply.github.com> Files changed: A news/4026.bugfix M Products/CMFPlone/Portal.py --- last_commit.txt | 49 +++++++++++++++++++++---------------------------- 1 file changed, 21 insertions(+), 28 deletions(-) diff --git a/last_commit.txt b/last_commit.txt index 74616c474d..2c865e8426 100644 --- a/last_commit.txt +++ b/last_commit.txt @@ -2,35 +2,28 @@ Repository: Products.CMFPlone Branch: refs/heads/master -Date: 2024-10-13T16:29:58+02:00 -Author: jackahl (jackahl) -Commit: https://github.com/plone/Products.CMFPlone/commit/cf0c46038eddbeff4e9e87c5a03df93ce1789e3a - -move all permissions for controlpanels to unifed file - -Files changed: -A news/4028.bugfix -M Products/CMFPlone/controlpanel/browser/configure.zcml -M Products/CMFPlone/controlpanel/permissions.zcml - -b'diff --git a/Products/CMFPlone/controlpanel/browser/configure.zcml b/Products/CMFPlone/controlpanel/browser/configure.zcml\nindex 1a8231c590..7cca9f0b3a 100644\n--- a/Products/CMFPlone/controlpanel/browser/configure.zcml\n+++ b/Products/CMFPlone/controlpanel/browser/configure.zcml\n@@ -4,18 +4,6 @@\n xmlns:zcml="http://namespaces.zope.org/zcml"\n >\n \n- \n-\n- \n- \n- \n-\n \n \n \n- \n-\n- \n-\n \n \n \n+ \n+\n+ \n+ \n+ \n+\n+ \n+\n+ \n+\n \ndiff --git a/news/4028.bugfix b/news/4028.bugfix\nnew file mode 100644\nindex 0000000000..d0916ccdf0\n--- /dev/null\n+++ b/news/4028.bugfix\n@@ -0,0 +1,2 @@\n+move all permission definitions for controlpanels to unifed file from controlpanel directory\n+[jackahl]\n' - -Repository: Products.CMFPlone - - -Branch: refs/heads/master -Date: 2024-10-13T23:05:35+02:00 -Author: Gil Forcada Codinachs (gforcada) -Commit: https://github.com/plone/Products.CMFPlone/commit/f7f0b19197da7917db154cbb383bede97e1a90a7 - -Merge pull request #4030 from plone/cp-permissions - -move all permissions for controlpanels to unifed file +Date: 2024-10-15T22:21:08-07:00 +Author: Wesley Barroso Lopes (wesleybl) +Commit: https://github.com/plone/Products.CMFPlone/commit/9a1a62bb0ed4b208d303748700a5d0a126bd21d2 + +Avoid POSKeyError when commit occurs and we have savepoint that involves (#4026) + +Plone Site + +When ZODB handles savepoint and we have changes in Plone Site at that +savepoint, it changes the `_p_estimated_size` attribute of Plone Site. +This is an assignment to one of the special persistency attributes +(identified by an _p_ name prefix); it should happen without access to +any other attributes of obj. But obj._tree is accessed in __setattr__ of +PloneSite class and results in a ZODB load which apparently fails. + +See: https://github.com/plone/plone.restapi/pull/1823#issuecomment-2402855105 + +Co-authored-by: Rohan Shaw <86848116+rohnsha0@users.noreply.github.com> Files changed: -A news/4028.bugfix -M Products/CMFPlone/controlpanel/browser/configure.zcml -M Products/CMFPlone/controlpanel/permissions.zcml +A news/4026.bugfix +M Products/CMFPlone/Portal.py -b'diff --git a/Products/CMFPlone/controlpanel/browser/configure.zcml b/Products/CMFPlone/controlpanel/browser/configure.zcml\nindex 1a8231c590..7cca9f0b3a 100644\n--- a/Products/CMFPlone/controlpanel/browser/configure.zcml\n+++ b/Products/CMFPlone/controlpanel/browser/configure.zcml\n@@ -4,18 +4,6 @@\n xmlns:zcml="http://namespaces.zope.org/zcml"\n >\n \n- \n-\n- \n- \n- \n-\n \n \n \n- \n-\n- \n-\n \n \n \n+ \n+\n+ \n+ \n+ \n+\n+ \n+\n+ \n+\n \ndiff --git a/news/4028.bugfix b/news/4028.bugfix\nnew file mode 100644\nindex 0000000000..d0916ccdf0\n--- /dev/null\n+++ b/news/4028.bugfix\n@@ -0,0 +1,2 @@\n+move all permission definitions for controlpanels to unifed file from controlpanel directory\n+[jackahl]\n' +b'diff --git a/Products/CMFPlone/Portal.py b/Products/CMFPlone/Portal.py\nindex cbf4c91149..878872e666 100644\n--- a/Products/CMFPlone/Portal.py\n+++ b/Products/CMFPlone/Portal.py\n@@ -61,7 +61,7 @@ def __getattr__(self, name):\n \n def __setattr__(self, name, obj):\n # handle re setting an item as an attribute\n- if self._tree is not None and name in self:\n+ if not name.startswith("_") and self._tree is not None and name in self:\n del self[name]\n self[name] = obj\n else:\ndiff --git a/news/4026.bugfix b/news/4026.bugfix\nnew file mode 100644\nindex 0000000000..a51ab29b2e\n--- /dev/null\n+++ b/news/4026.bugfix\n@@ -0,0 +1 @@\n+Avoid POSKeyError when commit occurs and we have savepoint that involves Plone Site. @wesleybl\n'