Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Link integrity broke copy&paste of content items.

  • Loading branch information...
commit 23bed2de7e6fffe8c1b9dc8683fc6c108f5db86d 1 parent 42f6d2e
Godefroid Chapelle gotcha authored
4 CHANGES.txt
View
@@ -4,6 +4,10 @@ Changelog
1.4.4 - unreleased
------------------
+- Link integrity broke copy&paste of content items.
+ This fixes http://dev.plone.org/plone/ticket/12206.
+ [gotcha]
+
- Provide Archetypes-only fallback if `plone.uuid` is not available,
restoring compatibility with Plone 4.0.x.
[witsch]
10 plone/app/linkintegrity/handlers.py
View
@@ -64,6 +64,16 @@ def getObjectsFromLinks(base, links):
def modifiedArchetype(obj, event):
""" an archetype based object was modified """
+ pu = getToolByName(obj, 'portal_url', None)
+ if pu is None:
+ # `getObjectFromLinks` is not possible without access
+ # to `portal_url`
+ return
+ rc = getToolByName(obj, 'reference_catalog', None)
+ if rc is None:
+ # `updateReferences` is not possible without access
+ # to `reference_catalog`
+ return
refs = set()
for field in obj.Schema().fields():
if isinstance(field, TextField):
17 plone/app/linkintegrity/tests/test_can_paste.py
View
@@ -0,0 +1,17 @@
+from Products.PloneTestCase import PloneTestCase
+from plone.app.linkintegrity.tests import layer
+
+
+PloneTestCase.setupPloneSite()
+
+
+class PasteTestCase(PloneTestCase.PloneTestCase):
+
+ layer = layer.integrity
+
+ def test_can_paste(self):
+ self.setRoles(('Manager',))
+ cp = self.portal.manage_copyObjects(['doc1'])
+ import transaction
+ transaction.savepoint()
+ self.portal.manage_pasteObjects(cp)
Please sign in to comment.
Something went wrong with that request. Please try again.