Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed AttributeError on physicalPathToURL when getRequest cannot get …

…a request.

AttributeError: 'NoneType' object has no attribute 'physicalPathToURL'
We use the REQUEST from the context in that case.
  • Loading branch information...
commit 1605c112f486956457eab5f91c647570495558c1 1 parent cd02cce
Maurits van Rees mauritsvanrees authored
Showing with 7 additions and 0 deletions.
  1. +5 −0 CHANGES.txt
  2. +2 −0  Products/TinyMCE/utility.py
5 CHANGES.txt
View
@@ -5,6 +5,11 @@ HISTORY
1.2.11 (unreleased)
-------------------
+- Fixed AttributeError: ``NoneType`` object has no attribute
+ ``physicalPathToURL`` when getRequest cannot get a request. Use the
+ REQUEST from the context in that case.
+ [maurits]
+
- Determine mimetype correctly for plone.app.textfield RichText widgets with
ignoreContext = True (such as on add forms).
(Requires plone.app.textfield >= 1.1.1)
2  Products/TinyMCE/utility.py
View
@@ -777,6 +777,8 @@ def getConfiguration(self, context=None, field=None, request=None):
portal = getToolByName(self, 'portal_url').getPortalObject()
#absolute_url doesn't work because this tool is called has utility
request = getRequest()
+ if request is None:
+ request = context.REQUEST
portal_path = portal.getPhysicalPath()
results['portal_url'] = request.physicalPathToURL(portal_path)
nav_root = getNavigationRootObject(context, portal)
Please sign in to comment.
Something went wrong with that request. Please try again.