From a92a4c2bc17fc4529b88ff0096254caa2e518aa3 Mon Sep 17 00:00:00 2001 From: thet Date: Sat, 24 Dec 2016 03:09:39 -0600 Subject: [PATCH] [fc] Repository: plone.app.upgrade Branch: refs/heads/master Date: 2016-12-23T14:28:36-06:00 Author: Johannes Raggam (thet) Commit: https://github.com/plone/plone.app.upgrade/commit/02cf65bee9d48cf678f7ad77d76c5164bae0297f New mockup releases for Plone 5.0 and 5.1. Files changed: A plone/app/upgrade/v50/profiles/to_507/registry.xml M CHANGES.rst M plone/app/upgrade/v50/configure.zcml M plone/app/upgrade/v50/final.py M plone/app/upgrade/v50/profiles.zcml M plone/app/upgrade/v51/profiles/to_beta1/registry.xml Repository: plone.app.upgrade Branch: refs/heads/master Date: 2016-12-24T03:09:39-06:00 Author: Johannes Raggam (thet) Commit: https://github.com/plone/plone.app.upgrade/commit/1758b0c479b36100da80c1ea700c17ad3040b456 Merge pull request #101 from plone/thet-newmockup New mockup releases for Plone 5.0 and 5.1. Files changed: A plone/app/upgrade/v50/profiles/to_507/registry.xml M CHANGES.rst M plone/app/upgrade/v50/configure.zcml M plone/app/upgrade/v50/final.py M plone/app/upgrade/v50/profiles.zcml M plone/app/upgrade/v51/profiles/to_beta1/registry.xml --- last_commit.txt | 392 +++++++++++++++++++++++++----------------------- 1 file changed, 203 insertions(+), 189 deletions(-) diff --git a/last_commit.txt b/last_commit.txt index 1b67b1ff4c..fd42a95070 100644 --- a/last_commit.txt +++ b/last_commit.txt @@ -1,226 +1,240 @@ -Repository: plone.app.discussion +Repository: plone.app.upgrade Branch: refs/heads/master -Date: 2016-09-20T13:05:24+02:00 -Author: Gil Forcada (gforcada) -Commit: https://github.com/plone/plone.app.discussion/commit/26a21a12d5d497c24bf5be27d37450b1ebbdf1f1 +Date: 2016-12-23T14:28:36-06:00 +Author: Johannes Raggam (thet) +Commit: https://github.com/plone/plone.app.upgrade/commit/02cf65bee9d48cf678f7ad77d76c5164bae0297f -Reindex comments when they are modified +New mockup releases for Plone 5.0 and 5.1. Files changed: +A plone/app/upgrade/v50/profiles/to_507/registry.xml M CHANGES.rst -M plone/app/discussion/browser/comment.py -M plone/app/discussion/subscribers.py -M plone/app/discussion/subscribers.zcml -M plone/app/discussion/tests/test_catalog.py +M plone/app/upgrade/v50/configure.zcml +M plone/app/upgrade/v50/final.py +M plone/app/upgrade/v50/profiles.zcml +M plone/app/upgrade/v51/profiles/to_beta1/registry.xml diff --git a/CHANGES.rst b/CHANGES.rst -index 894e27f..983dc9f 100644 +index 01577d9..b8d9491 100644 --- a/CHANGES.rst +++ b/CHANGES.rst -@@ -10,7 +10,8 @@ Breaking changes: +@@ -11,6 +11,9 @@ Breaking changes: New features: --- *add item here* -+- Reindex comments when they are modified. -+ [gforcada] - - Bug fixes: - -diff --git a/plone/app/discussion/browser/comment.py b/plone/app/discussion/browser/comment.py -index 9f22d93..6b9b5d3 100644 ---- a/plone/app/discussion/browser/comment.py -+++ b/plone/app/discussion/browser/comment.py -@@ -12,6 +12,8 @@ - from z3c.form import button - from zope.component import getMultiAdapter - from zope.component import getUtility -+from zope.event import notify -+from zope.lifecycleevent import ObjectModifiedEvent - - - class View(BrowserView): -@@ -91,6 +93,8 @@ def handleComment(self, action): - - # Update text - self.context.text = data['text'] -+ # Notify that the object has been modified -+ notify(ObjectModifiedEvent(self.context)) - - # Redirect to comment - IStatusMessage(self.request).add(_(u'comment_edit_notification', -diff --git a/plone/app/discussion/subscribers.py b/plone/app/discussion/subscribers.py -index 9663243..c3717e5 100644 ---- a/plone/app/discussion/subscribers.py -+++ b/plone/app/discussion/subscribers.py -@@ -3,7 +3,7 @@ - - - def index_object(obj, event): -- """Index the object when it is added to the conversation. -+ """Index the object when it is added/modified to the conversation. - """ - catalog = getToolByName(obj, 'portal_catalog') - return catalog.reindexObject(obj) -diff --git a/plone/app/discussion/subscribers.zcml b/plone/app/discussion/subscribers.zcml -index befc5f3..5bb3535 100644 ---- a/plone/app/discussion/subscribers.zcml -+++ b/plone/app/discussion/subscribers.zcml -@@ -41,6 +41,12 @@ - - ++- New mockup releases for Plone 5.0 and 5.1. ++ [thet] + -+ -diff --git a/plone/app/discussion/tests/test_catalog.py b/plone/app/discussion/tests/test_catalog.py -index 9cfcbfc..91b4c62 100644 ---- a/plone/app/discussion/tests/test_catalog.py -+++ b/plone/app/discussion/tests/test_catalog.py -@@ -9,6 +9,8 @@ - from Products.CMFCore.utils import getToolByName - from zope.annotation.interfaces import IAnnotations - from zope.component import createObject -+from zope.event import notify -+from zope.lifecycleevent import ObjectModifiedEvent - - import transaction - import unittest2 as unittest -@@ -329,6 +331,13 @@ def test_delete_comment(self): - )) - self.assertEqual(len(brains), 0) - -+ def test_reindex_comment(self): -+ # Make sure a comment is reindexed on the catalog when is modified -+ self.comment.text = 'Another text' -+ notify(ObjectModifiedEvent(self.comment)) -+ brains = self.catalog.searchResults(SearchableText='Another text') -+ self.assertEqual(len(brains), 1) + - Remove jquery.cookie from plone-logged-in bundle's stub_js_modules. + The toolbar, which has a dependency on jquery.cookie, + was moved from the plone bundle to plone-logged-in in CMPlone 5.1a2. +diff --git a/plone/app/upgrade/v50/configure.zcml b/plone/app/upgrade/v50/configure.zcml +index 9fb12f6..af8efe0 100644 +--- a/plone/app/upgrade/v50/configure.zcml ++++ b/plone/app/upgrade/v50/configure.zcml +@@ -327,4 +327,17 @@ + + + ++ ++ ++ ++ ++ ++ + +diff --git a/plone/app/upgrade/v50/final.py b/plone/app/upgrade/v50/final.py +index 127fd32..82a3152 100644 +--- a/plone/app/upgrade/v50/final.py ++++ b/plone/app/upgrade/v50/final.py +@@ -96,3 +96,8 @@ def to502(context): + def to503(context): + """5.0.2 -> 5.0.3""" + loadMigrationProfile(context, 'profile-plone.app.upgrade.v50:to503') + - def test_remove_comments_when_content_object_is_removed(self): - """Make sure all comments are removed from the catalog, if the content - object is removed. ++ ++def to507(context): ++ """5.0.6 -> 5.0.7""" ++ loadMigrationProfile(context, 'profile-plone.app.upgrade.v50:to507') +diff --git a/plone/app/upgrade/v50/profiles.zcml b/plone/app/upgrade/v50/profiles.zcml +index 16cf6db..77ff768 100644 +--- a/plone/app/upgrade/v50/profiles.zcml ++++ b/plone/app/upgrade/v50/profiles.zcml +@@ -111,4 +111,13 @@ + provides="Products.GenericSetup.interfaces.EXTENSION" + /> + ++ ++ + +diff --git a/plone/app/upgrade/v50/profiles/to_507/registry.xml b/plone/app/upgrade/v50/profiles/to_507/registry.xml +new file mode 100644 +index 0000000..ec0debb +--- /dev/null ++++ b/plone/app/upgrade/v50/profiles/to_507/registry.xml +@@ -0,0 +1,13 @@ ++ ++ ++ ++ 2016-12-23 00:00:00 ++ ++ ++ 2016-12-23 00:00:00 ++ ++ +diff --git a/plone/app/upgrade/v51/profiles/to_beta1/registry.xml b/plone/app/upgrade/v51/profiles/to_beta1/registry.xml +index 9a622bd..569adc6 100644 +--- a/plone/app/upgrade/v51/profiles/to_beta1/registry.xml ++++ b/plone/app/upgrade/v51/profiles/to_beta1/registry.xml +@@ -3,7 +3,7 @@ + + + +- 2016-12-13 00:00:00 ++ 2016-12-23 00:00:00 + + + 2016-12-13 00:00:00 -Repository: plone.app.discussion +Repository: plone.app.upgrade Branch: refs/heads/master -Date: 2016-12-22T18:34:50+01:00 -Author: Alessandro Pisa (ale-rt) -Commit: https://github.com/plone/plone.app.discussion/commit/17fd1b005debe976eea6a9f231f825584180c3f0 +Date: 2016-12-24T03:09:39-06:00 +Author: Johannes Raggam (thet) +Commit: https://github.com/plone/plone.app.upgrade/commit/1758b0c479b36100da80c1ea700c17ad3040b456 -Merge pull request #109 from derFreitag/gforcada-patch-1 +Merge pull request #101 from plone/thet-newmockup -Reindex comments when they are modified +New mockup releases for Plone 5.0 and 5.1. Files changed: +A plone/app/upgrade/v50/profiles/to_507/registry.xml M CHANGES.rst -M plone/app/discussion/browser/comment.py -M plone/app/discussion/subscribers.py -M plone/app/discussion/subscribers.zcml -M plone/app/discussion/tests/test_catalog.py +M plone/app/upgrade/v50/configure.zcml +M plone/app/upgrade/v50/final.py +M plone/app/upgrade/v50/profiles.zcml +M plone/app/upgrade/v51/profiles/to_beta1/registry.xml diff --git a/CHANGES.rst b/CHANGES.rst -index 32892c4..234d8d3 100644 +index 01577d9..b8d9491 100644 --- a/CHANGES.rst +++ b/CHANGES.rst -@@ -10,7 +10,8 @@ Breaking changes: +@@ -11,6 +11,9 @@ Breaking changes: New features: --- *add item here* -+- Reindex comments when they are modified. -+ [gforcada] - - Bug fixes: - -diff --git a/plone/app/discussion/browser/comment.py b/plone/app/discussion/browser/comment.py -index 9f22d93..6b9b5d3 100644 ---- a/plone/app/discussion/browser/comment.py -+++ b/plone/app/discussion/browser/comment.py -@@ -12,6 +12,8 @@ - from z3c.form import button - from zope.component import getMultiAdapter - from zope.component import getUtility -+from zope.event import notify -+from zope.lifecycleevent import ObjectModifiedEvent - - - class View(BrowserView): -@@ -91,6 +93,8 @@ def handleComment(self, action): - - # Update text - self.context.text = data['text'] -+ # Notify that the object has been modified -+ notify(ObjectModifiedEvent(self.context)) - - # Redirect to comment - IStatusMessage(self.request).add(_(u'comment_edit_notification', -diff --git a/plone/app/discussion/subscribers.py b/plone/app/discussion/subscribers.py -index 9663243..c3717e5 100644 ---- a/plone/app/discussion/subscribers.py -+++ b/plone/app/discussion/subscribers.py -@@ -3,7 +3,7 @@ - - - def index_object(obj, event): -- """Index the object when it is added to the conversation. -+ """Index the object when it is added/modified to the conversation. - """ - catalog = getToolByName(obj, 'portal_catalog') - return catalog.reindexObject(obj) -diff --git a/plone/app/discussion/subscribers.zcml b/plone/app/discussion/subscribers.zcml -index befc5f3..5bb3535 100644 ---- a/plone/app/discussion/subscribers.zcml -+++ b/plone/app/discussion/subscribers.zcml -@@ -41,6 +41,12 @@ - - ++- New mockup releases for Plone 5.0 and 5.1. ++ [thet] + -+ -diff --git a/plone/app/discussion/tests/test_catalog.py b/plone/app/discussion/tests/test_catalog.py -index 9cfcbfc..91b4c62 100644 ---- a/plone/app/discussion/tests/test_catalog.py -+++ b/plone/app/discussion/tests/test_catalog.py -@@ -9,6 +9,8 @@ - from Products.CMFCore.utils import getToolByName - from zope.annotation.interfaces import IAnnotations - from zope.component import createObject -+from zope.event import notify -+from zope.lifecycleevent import ObjectModifiedEvent - - import transaction - import unittest2 as unittest -@@ -329,6 +331,13 @@ def test_delete_comment(self): - )) - self.assertEqual(len(brains), 0) - -+ def test_reindex_comment(self): -+ # Make sure a comment is reindexed on the catalog when is modified -+ self.comment.text = 'Another text' -+ notify(ObjectModifiedEvent(self.comment)) -+ brains = self.catalog.searchResults(SearchableText='Another text') -+ self.assertEqual(len(brains), 1) + - Remove jquery.cookie from plone-logged-in bundle's stub_js_modules. + The toolbar, which has a dependency on jquery.cookie, + was moved from the plone bundle to plone-logged-in in CMPlone 5.1a2. +diff --git a/plone/app/upgrade/v50/configure.zcml b/plone/app/upgrade/v50/configure.zcml +index 9fb12f6..af8efe0 100644 +--- a/plone/app/upgrade/v50/configure.zcml ++++ b/plone/app/upgrade/v50/configure.zcml +@@ -327,4 +327,17 @@ + + + ++ ++ ++ ++ ++ ++ + +diff --git a/plone/app/upgrade/v50/final.py b/plone/app/upgrade/v50/final.py +index 127fd32..82a3152 100644 +--- a/plone/app/upgrade/v50/final.py ++++ b/plone/app/upgrade/v50/final.py +@@ -96,3 +96,8 @@ def to502(context): + def to503(context): + """5.0.2 -> 5.0.3""" + loadMigrationProfile(context, 'profile-plone.app.upgrade.v50:to503') + - def test_remove_comments_when_content_object_is_removed(self): - """Make sure all comments are removed from the catalog, if the content - object is removed. ++ ++def to507(context): ++ """5.0.6 -> 5.0.7""" ++ loadMigrationProfile(context, 'profile-plone.app.upgrade.v50:to507') +diff --git a/plone/app/upgrade/v50/profiles.zcml b/plone/app/upgrade/v50/profiles.zcml +index 16cf6db..77ff768 100644 +--- a/plone/app/upgrade/v50/profiles.zcml ++++ b/plone/app/upgrade/v50/profiles.zcml +@@ -111,4 +111,13 @@ + provides="Products.GenericSetup.interfaces.EXTENSION" + /> + ++ ++ + +diff --git a/plone/app/upgrade/v50/profiles/to_507/registry.xml b/plone/app/upgrade/v50/profiles/to_507/registry.xml +new file mode 100644 +index 0000000..ec0debb +--- /dev/null ++++ b/plone/app/upgrade/v50/profiles/to_507/registry.xml +@@ -0,0 +1,13 @@ ++ ++ ++ ++ 2016-12-23 00:00:00 ++ ++ ++ 2016-12-23 00:00:00 ++ ++ +diff --git a/plone/app/upgrade/v51/profiles/to_beta1/registry.xml b/plone/app/upgrade/v51/profiles/to_beta1/registry.xml +index 9a622bd..569adc6 100644 +--- a/plone/app/upgrade/v51/profiles/to_beta1/registry.xml ++++ b/plone/app/upgrade/v51/profiles/to_beta1/registry.xml +@@ -3,7 +3,7 @@ + + + +- 2016-12-13 00:00:00 ++ 2016-12-23 00:00:00 + + + 2016-12-13 00:00:00