Author: fabien
Date: 2010-03-23 16:17:06 +0100 (Tue, 23 Mar 2010)
New Revision: 28714

Modified:
   branches/1.3/lib/view/sfViewCacheManager.class.php
   branches/1.4/lib/view/sfViewCacheManager.class.php
Log:
[1.3, 1.4] fixed caching of 404 pages (closes #8339)

Modified: branches/1.3/lib/view/sfViewCacheManager.class.php
===================================================================
--- branches/1.3/lib/view/sfViewCacheManager.class.php  2010-03-23 15:08:22 UTC 
(rev 28713)
+++ branches/1.3/lib/view/sfViewCacheManager.class.php  2010-03-23 15:17:06 UTC 
(rev 28714)
@@ -142,6 +142,13 @@
       if (!$contextualPrefix)
       {
         list($route_name, $params) = 
$this->controller->convertUrlStringToParameters($this->routing->getCurrentInternalUri());
+
+        // if there is no module/action, it means that we have a 404 and the 
user is trying to cache it
+        if (!isset($params['module']) || !isset($params['action']))
+        {
+          $params['module'] = sfConfig::get('sf_error_404_module');
+          $params['action'] = sfConfig::get('sf_error_404_action');
+        }
         $cacheKey = $this->convertParametersToKey($params);
       }
       else

Modified: branches/1.4/lib/view/sfViewCacheManager.class.php
===================================================================
--- branches/1.4/lib/view/sfViewCacheManager.class.php  2010-03-23 15:08:22 UTC 
(rev 28713)
+++ branches/1.4/lib/view/sfViewCacheManager.class.php  2010-03-23 15:17:06 UTC 
(rev 28714)
@@ -142,6 +142,13 @@
       if (!$contextualPrefix)
       {
         list($route_name, $params) = 
$this->controller->convertUrlStringToParameters($this->routing->getCurrentInternalUri());
+
+        // if there is no module/action, it means that we have a 404 and the 
user is trying to cache it
+        if (!isset($params['module']) || !isset($params['action']))
+        {
+          $params['module'] = sfConfig::get('sf_error_404_module');
+          $params['action'] = sfConfig::get('sf_error_404_action');
+        }
         $cacheKey = $this->convertParametersToKey($params);
       }
       else

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to