From 5f479a6c96fa4d0aab406ea3531922b7fe571f46 Mon Sep 17 00:00:00 2001 From: pbauer Date: Mon, 17 Jul 2017 10:46:05 +0200 Subject: [PATCH] [fc] Repository: plone.app.linkintegrity Branch: refs/heads/master Date: 2017-06-20T15:19:02+02:00 Author: Philip Bauer (pbauer) Commit: https://github.com/plone/plone.app.linkintegrity/commit/d6cbc67bff0e2fc7344899679266cd053a3ce29e Do not fail on invalid objects in referenec_catalog. Fixes #32 and #48 Files changed: M CHANGES.rst M plone/app/linkintegrity/upgrades.py Repository: plone.app.linkintegrity Branch: refs/heads/master Date: 2017-06-22T18:04:40+02:00 Author: Philip Bauer (pbauer) Commit: https://github.com/plone/plone.app.linkintegrity/commit/8e65fa1117826c0b3f49ddf8087bef180e8b9240 add log-message Files changed: M plone/app/linkintegrity/upgrades.py Repository: plone.app.linkintegrity Branch: refs/heads/master Date: 2017-07-17T10:46:05+02:00 Author: Philip Bauer (pbauer) Commit: https://github.com/plone/plone.app.linkintegrity/commit/fc6d90f7811913bbf804c03fce44ecb448d46e73 Merge pull request #56 from plone/allow_inconsistent_refcatalog Do not fail on invalid objects in referenec_catalog. Fixes #32 and #48 Files changed: M CHANGES.rst M plone/app/linkintegrity/upgrades.py --- last_commit.txt | 170 +++++++++++++++++++++++++++++++----------------- 1 file changed, 110 insertions(+), 60 deletions(-) diff --git a/last_commit.txt b/last_commit.txt index efb0422f73..d2fe23d84c 100644 --- a/last_commit.txt +++ b/last_commit.txt @@ -1,90 +1,140 @@ -Repository: plone.app.contenttypes +Repository: plone.app.linkintegrity Branch: refs/heads/master -Date: 2017-07-14T13:23:49+02:00 -Author: Gil Forcada (gforcada) -Commit: https://github.com/plone/plone.app.contenttypes/commit/81b2391644a4f8de6e4fe802c3a4b03cf47bb288 - -Remove plone.app.robotframework 'reload' extra +Date: 2017-06-20T15:19:02+02:00 +Author: Philip Bauer (pbauer) +Commit: https://github.com/plone/plone.app.linkintegrity/commit/d6cbc67bff0e2fc7344899679266cd053a3ce29e -Related to https://github.com/plone/Products.CMFPlone/issues/2104 +Do not fail on invalid objects in referenec_catalog. Fixes #32 and #48 Files changed: M CHANGES.rst -M setup.py +M plone/app/linkintegrity/upgrades.py diff --git a/CHANGES.rst b/CHANGES.rst -index c37b028b..23cb51f9 100644 +index e2cc5fa..2a0912a 100644 --- a/CHANGES.rst +++ b/CHANGES.rst -@@ -24,6 +24,9 @@ Bug fixes: - - Actually migrate all migratable types when passing 'all' to at-dx migration. - [pbauer] +@@ -14,7 +14,8 @@ New features: + + Bug fixes: -+- Remove plone.app.robotframework 'reload' extra. -+ This allows to remove quite some other external dependencies that are not Python 3 compatible. -+ [gforcada] +-- *add item here* ++- Do not fail on invalid objects in referenec_catalog. Fixes #32 and #48 ++ [pbauer] - 1.4.1 (2017-07-03) - ------------------ -diff --git a/setup.py b/setup.py -index d855088b..eee13ef2 100644 ---- a/setup.py -+++ b/setup.py -@@ -58,7 +58,7 @@ def read(*rnames): - 'test': [ - 'archetypes.schemaextender', - 'lxml', -- 'plone.app.robotframework [debug, reload] > 0.9.8', # create image and file content for Image, File and News Item if not given. # noqa -+ 'plone.app.robotframework [debug] > 0.9.8', # create image and file content for Image, File and News Item if not given. # noqa - 'plone.app.testing [robot] >= 4.2.4', # we need ROBOT_TEST_LEVEL - # 'plone.dexterity >= 2.3.0', # fixes setting default values # NOT RELEASED YET. # noqa - 'Products.ATContentTypes', - - -Repository: plone.app.contenttypes + + 3.3.1 (2017-06-01) +diff --git a/plone/app/linkintegrity/upgrades.py b/plone/app/linkintegrity/upgrades.py +index 56d47bf..3bd44c5 100644 +--- a/plone/app/linkintegrity/upgrades.py ++++ b/plone/app/linkintegrity/upgrades.py +@@ -17,6 +17,9 @@ def migrate_linkintegrity_relations(context): + continue + source_obj = uuidToObject(brain.sourceUID) + target_obj = uuidToObject(brain.targetUID) ++ if source_obj is None or target_obj is None: ++ # reference_catalog my be inconsistent ++ continue + # Delete old reference + reference_catalog.deleteReference( + source_obj, target_obj, relationship=referencedRelationship) + + +Repository: plone.app.linkintegrity Branch: refs/heads/master -Date: 2017-07-17T10:21:05+02:00 +Date: 2017-06-22T18:04:40+02:00 Author: Philip Bauer (pbauer) -Commit: https://github.com/plone/plone.app.contenttypes/commit/b2dbc6e0d196218b64164cea0c9e0eb93e9e7aab +Commit: https://github.com/plone/plone.app.linkintegrity/commit/8e65fa1117826c0b3f49ddf8087bef180e8b9240 + +add log-message + +Files changed: +M plone/app/linkintegrity/upgrades.py + +diff --git a/plone/app/linkintegrity/upgrades.py b/plone/app/linkintegrity/upgrades.py +index 3bd44c5..0a93b8d 100644 +--- a/plone/app/linkintegrity/upgrades.py ++++ b/plone/app/linkintegrity/upgrades.py +@@ -5,6 +5,9 @@ + from Products.CMFCore.utils import getToolByName + from zope.lifecycleevent import modified + ++import logging ++log = logging.getLogger(__name__) ++ + + def migrate_linkintegrity_relations(context): + """Migrate linkintegrity-relation from reference_catalog to zc.relation. +@@ -18,7 +21,8 @@ def migrate_linkintegrity_relations(context): + source_obj = uuidToObject(brain.sourceUID) + target_obj = uuidToObject(brain.targetUID) + if source_obj is None or target_obj is None: +- # reference_catalog my be inconsistent ++ # reference_catalog may be inconsistent ++ log.info('Cannot delete relation since the relation_catalog is inconsistent.') # noqa: E501 + continue + # Delete old reference + reference_catalog.deleteReference( + -Merge pull request #416 from plone/gforcada-remove-reload-extra +Repository: plone.app.linkintegrity -Remove plone.app.robotframework 'reload' extra + +Branch: refs/heads/master +Date: 2017-07-17T10:46:05+02:00 +Author: Philip Bauer (pbauer) +Commit: https://github.com/plone/plone.app.linkintegrity/commit/fc6d90f7811913bbf804c03fce44ecb448d46e73 + +Merge pull request #56 from plone/allow_inconsistent_refcatalog + +Do not fail on invalid objects in referenec_catalog. Fixes #32 and #48 Files changed: M CHANGES.rst -M setup.py +M plone/app/linkintegrity/upgrades.py diff --git a/CHANGES.rst b/CHANGES.rst -index c37b028b..23cb51f9 100644 +index e2cc5fa..2a0912a 100644 --- a/CHANGES.rst +++ b/CHANGES.rst -@@ -24,6 +24,9 @@ Bug fixes: - - Actually migrate all migratable types when passing 'all' to at-dx migration. - [pbauer] +@@ -14,7 +14,8 @@ New features: + + Bug fixes: + +-- *add item here* ++- Do not fail on invalid objects in referenec_catalog. Fixes #32 and #48 ++ [pbauer] + + + 3.3.1 (2017-06-01) +diff --git a/plone/app/linkintegrity/upgrades.py b/plone/app/linkintegrity/upgrades.py +index 56d47bf..0a93b8d 100644 +--- a/plone/app/linkintegrity/upgrades.py ++++ b/plone/app/linkintegrity/upgrades.py +@@ -5,6 +5,9 @@ + from Products.CMFCore.utils import getToolByName + from zope.lifecycleevent import modified -+- Remove plone.app.robotframework 'reload' extra. -+ This allows to remove quite some other external dependencies that are not Python 3 compatible. -+ [gforcada] ++import logging ++log = logging.getLogger(__name__) ++ - 1.4.1 (2017-07-03) - ------------------ -diff --git a/setup.py b/setup.py -index d855088b..eee13ef2 100644 ---- a/setup.py -+++ b/setup.py -@@ -58,7 +58,7 @@ def read(*rnames): - 'test': [ - 'archetypes.schemaextender', - 'lxml', -- 'plone.app.robotframework [debug, reload] > 0.9.8', # create image and file content for Image, File and News Item if not given. # noqa -+ 'plone.app.robotframework [debug] > 0.9.8', # create image and file content for Image, File and News Item if not given. # noqa - 'plone.app.testing [robot] >= 4.2.4', # we need ROBOT_TEST_LEVEL - # 'plone.dexterity >= 2.3.0', # fixes setting default values # NOT RELEASED YET. # noqa - 'Products.ATContentTypes', + def migrate_linkintegrity_relations(context): + """Migrate linkintegrity-relation from reference_catalog to zc.relation. +@@ -17,6 +20,10 @@ def migrate_linkintegrity_relations(context): + continue + source_obj = uuidToObject(brain.sourceUID) + target_obj = uuidToObject(brain.targetUID) ++ if source_obj is None or target_obj is None: ++ # reference_catalog may be inconsistent ++ log.info('Cannot delete relation since the relation_catalog is inconsistent.') # noqa: E501 ++ continue + # Delete old reference + reference_catalog.deleteReference( + source_obj, target_obj, relationship=referencedRelationship)