From de8a2b6087eed50fe87bff462e3a7dba7210de18 Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Fri, 13 Jan 2012 15:15:28 +0100 Subject: [PATCH] Fixed AttributeError when using inline editing. AttributeError: 'ATDocumentFieldsView' object has no attribute 'absolute_url'. Inline editing then still does not work though (checked on Plone 4.2 dev). --- CHANGES.txt | 5 +++++ Products/TinyMCE/utility.py | 7 +------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index d1f3f6610..1f6ad92fa 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -5,6 +5,11 @@ HISTORY 1.2.10 (unreleased) ------------------- +- Fixed AttributeError: 'ATDocumentFieldsView' object has no attribute + 'absolute_url' when using inline editing. Inline editing then still + does not work though (checked on Plone 4.2 dev). + [maurits] + - Fixed a few test failures in combination with five.pt. [maurits] diff --git a/Products/TinyMCE/utility.py b/Products/TinyMCE/utility.py index 60b92643a..37053c048 100644 --- a/Products/TinyMCE/utility.py +++ b/Products/TinyMCE/utility.py @@ -5,11 +5,6 @@ import simplejson as json from types import StringTypes from zope.component import getUtility, queryUtility -try: - from zope.component.hooks import getSite - getSite #Pyflakes -except ImportError: - from zope.app.component.hooks import getSite from zope.i18n import translate from zope.i18nmessageid import MessageFactory from zope.interface import classProvides @@ -754,7 +749,7 @@ def getConfiguration(self, context=None, field=None, request=None): else: results['contextmenu'] = False - portal = getSite() + portal = getToolByName(self, 'portal_url').getPortalObject() results['portal_url'] = aq_inner(portal).absolute_url() nav_root = getNavigationRootObject(context, portal) results['navigation_root_url'] = nav_root.absolute_url()