From 5cd3d9d772453022d79bfdf66433bff909d418e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Pablo=20Gim=C3=A9nez?= Date: Thu, 4 Apr 2013 18:13:23 -0300 Subject: [PATCH] Remove the override of grok views static method. This problem started with a merge at five.grok, http://svn.zope.org/five.grok/trunk/src/five/grok/meta.py?rev=123298&r1=112163&r2=123298 That merge removes the static resources grokker, maybe a not desired side effect of the merge. The static resource is documented by dexterity, and used by this package. To fix this problem, if static resources grokker doesn't come back to five.grok, we can use a method also documented at dexterity, http://plone.org/products/dexterity/documentation/manual/developer-manual/advanced/static-resources This way we use @@plone_portal_state/navigation_root_url as a base for our resources instead of the problematic static method. --- src/collective/cover/content.py | 16 ---------------- src/collective/cover/templates/compose.pt | 7 +++++-- src/collective/cover/templates/layoutedit.pt | 13 +++++++++---- .../cover/templates/removetilewidget.pt | 4 +++- src/collective/cover/templates/view.pt | 4 +++- 5 files changed, 20 insertions(+), 24 deletions(-) diff --git a/src/collective/cover/content.py b/src/collective/cover/content.py index b4e42bf31..bb6ee8eb3 100644 --- a/src/collective/cover/content.py +++ b/src/collective/cover/content.py @@ -53,12 +53,6 @@ class View(grok.View): grok.require('zope2.View') grok.name('view') - def update(self): - self.context = aq_inner(self.context) - portal_state = self.context.restrictedTraverse('@@plone_portal_state') - navroot_url = portal_state.navigation_root_url() - self.static = '%s/++resource++collective.cover' % navroot_url - class AddCTWidget(grok.View): grok.context(ICover) @@ -139,10 +133,6 @@ class RemoveTileWidget(grok.View): grok.name("removetilewidget") def __call__(self): - self.context = aq_inner(self.context) - portal_state = self.context.restrictedTraverse('@@plone_portal_state') - navroot_url = portal_state.navigation_root_url() - self.static = '%s/++resource++collective.cover' % navroot_url template = self.template if 'form.submitted' not in self.request: return template.render(self) @@ -169,9 +159,6 @@ class Compose(grok.View): def update(self): self.context = aq_inner(self.context) - portal_state = self.context.restrictedTraverse('@@plone_portal_state') - navroot_url = portal_state.navigation_root_url() - self.static = '%s/++resource++collective.cover' % navroot_url # XXX: used to lock the object when someone is editing it notify(EditBegunEvent(self.context)) @@ -184,9 +171,6 @@ class LayoutEdit(grok.View): def update(self): self.context = aq_inner(self.context) - portal_state = self.context.restrictedTraverse('@@plone_portal_state') - navroot_url = portal_state.navigation_root_url() - self.static = '%s/++resource++collective.cover' % navroot_url # XXX: used to lock the object when someone is editing it notify(EditBegunEvent(self.context)) diff --git a/src/collective/cover/templates/compose.pt b/src/collective/cover/templates/compose.pt index 82ec1a6a5..87ae97f0f 100644 --- a/src/collective/cover/templates/compose.pt +++ b/src/collective/cover/templates/compose.pt @@ -9,7 +9,8 @@