[CMF-checkins] SVN: CMF/trunk/CMFCore/ - CMFCore.PortalContent, CMFCore.FSSTXMethod: Cache headers from the

Jens Vagelpohl jens at dataflake.org
Thu Aug 18 12:54:20 EDT 2005


Log message for revision 37991:
  - CMFCore.PortalContent, CMFCore.FSSTXMethod: Cache headers from the 
    Caching Policy Manager never got set for DTML-based skins due to the 
    way the view template __call__ method was invoked. 
    (http://www.zope.org/Collectors/CMF/374)
  
    This new fix moves the change out of FSDTMLMethod.__call__ and into
    those places that invoke it.
  

Changed:
  U   CMF/trunk/CMFCore/FSDTMLMethod.py
  U   CMF/trunk/CMFCore/FSSTXMethod.py
  U   CMF/trunk/CMFCore/PortalContent.py
  U   CMF/trunk/CMFCore/tests/test_FSDTMLMethod.py

-=-
Modified: CMF/trunk/CMFCore/FSDTMLMethod.py
===================================================================
--- CMF/trunk/CMFCore/FSDTMLMethod.py	2005-08-18 16:43:36 UTC (rev 37990)
+++ CMF/trunk/CMFCore/FSDTMLMethod.py	2005-08-18 16:54:19 UTC (rev 37991)
@@ -110,11 +110,6 @@
         """Render the document given a client object, REQUEST mapping,
         Response, and key word arguments."""
 
-        # If a RESPONSE is not passed in, try to access it through the
-        # REQUEST.
-        if RESPONSE is None and REQUEST != {}:
-            RESPONSE = getattr(REQUEST, 'RESPONSE', None)
-
         self._updateFromFS()
 
         if not self._cache_namespace_keys:

Modified: CMF/trunk/CMFCore/FSSTXMethod.py
===================================================================
--- CMF/trunk/CMFCore/FSSTXMethod.py	2005-08-18 16:43:36 UTC (rev 37990)
+++ CMF/trunk/CMFCore/FSSTXMethod.py	2005-08-18 16:54:19 UTC (rev 37991)
@@ -127,7 +127,7 @@
         template = getattr( self, 'stxmethod_view', self._default_template )
 
         if getattr( template, 'isDocTemp', 0 ):
-            posargs = ( self, REQUEST )
+            posargs = ( self, REQUEST, RESPONSE )
         else:
             posargs = ()
 

Modified: CMF/trunk/CMFCore/PortalContent.py
===================================================================
--- CMF/trunk/CMFCore/PortalContent.py	2005-08-18 16:43:36 UTC (rev 37990)
+++ CMF/trunk/CMFCore/PortalContent.py	2005-08-18 16:54:19 UTC (rev 37991)
@@ -98,7 +98,7 @@
         if method_id:
             method = getattr(self, method_id)
             if getattr(aq_base(method), 'isDocTemp', 0):
-                return method(self, self.REQUEST)
+                return method(self, self.REQUEST, self.REQUEST['RESPONSE'])
             else:
                 return method()
         else:

Modified: CMF/trunk/CMFCore/tests/test_FSDTMLMethod.py
===================================================================
--- CMF/trunk/CMFCore/tests/test_FSDTMLMethod.py	2005-08-18 16:43:36 UTC (rev 37990)
+++ CMF/trunk/CMFCore/tests/test_FSDTMLMethod.py	2005-08-18 16:54:19 UTC (rev 37991)
@@ -63,7 +63,7 @@
         original_len = len( self.RESPONSE.headers )
         script = self._makeOne('testDTML', 'testDTML.dtml')
         script = script.__of__(self.root)
-        script(self.root, self.REQUEST)
+        script(self.root, self.REQUEST, self.RESPONSE)
         self.failUnless( len( self.RESPONSE.headers ) >= original_len + 2 )
         self.failUnless( 'foo' in self.RESPONSE.headers.keys() )
         self.failUnless( 'bar' in self.RESPONSE.headers.keys() )



More information about the CMF-checkins mailing list