From 98f1f3d6a431048c1fc929c5dd55de1f66fc8629 Mon Sep 17 00:00:00 2001 From: esteele Date: Sun, 20 Sep 2015 17:31:55 +0200 Subject: [PATCH] Move portal_properties settings to configuration registry commit b13db31e3c55fd5ed9320e9d0c93aea48366c883 Author: esteele Date: Fri Sep 18 10:14:56 2015 +0200 Remove pdb. commit 6b3e591583146ca661556ef50cafd02f62c79d46 Author: esteele Date: Fri Sep 18 09:50:06 2015 +0200 Fix registry id commit 9dfce9a739496b6023f93376535dccc9a9310517 Author: esteele Date: Thu Sep 17 18:34:42 2015 +0200 Use registry lookup for types_use_view_action_in_listings --- CHANGES.rst | 3 +++ plone/app/discussion/browser/comment.py | 9 +++++++-- .../app/discussion/tests/collection-integration-test.txt | 1 - 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 02f359d..1f4f381 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,9 @@ Changelog 2.4.8 (unreleased) ------------------ +- Use registry lookup for types_use_view_action_in_listings + [esteele] + - Remove discussion.css [pbauer] diff --git a/plone/app/discussion/browser/comment.py b/plone/app/discussion/browser/comment.py index 85ef885..837ca4e 100644 --- a/plone/app/discussion/browser/comment.py +++ b/plone/app/discussion/browser/comment.py @@ -1,11 +1,13 @@ from AccessControl import getSecurityManager from Acquisition import aq_inner from Acquisition import aq_parent +from zope.component import getUtility from Products.CMFCore.utils import getToolByName from Products.Five.browser import BrowserView from Products.statusmessages.interfaces import IStatusMessage from comments import CommentForm from plone.app.discussion import PloneAppDiscussionMessageFactory as _ +from plone.registry.interfaces import IRegistry from plone.z3cform.layout import wrap_form from z3c.form import button from zope.component import getMultiAdapter @@ -30,8 +32,11 @@ class View(BrowserView): def __call__(self): context = aq_inner(self.context) - ptool = getToolByName(context, 'portal_properties') - view_action_types = ptool.site_properties.typesUseViewActionInListings + + registry = getUtility(IRegistry) + view_action_types = registry.get( + 'plone.types_use_view_action_in_listings', []) + obj = aq_parent(aq_parent(context)) url = obj.absolute_url() diff --git a/plone/app/discussion/tests/collection-integration-test.txt b/plone/app/discussion/tests/collection-integration-test.txt index ac1ea22..7e42343 100644 --- a/plone/app/discussion/tests/collection-integration-test.txt +++ b/plone/app/discussion/tests/collection-integration-test.txt @@ -15,7 +15,6 @@ Create a collection. >>> from plone.app.discussion.testing import COLLECTION_TYPE >>> browser.getLink(url='++add++' + COLLECTION_TYPE).click() >>> open('/tmp/testbrowser.html', 'w').write(browser.contents) - >>> import pdb; pdb.set_trace() >>> browser.getControl('form.widgets.IDublinCore.title').value = 'Foo Comment Collection' >>> browser.getControl('Save').click() >>> print browser.contents