Development

#8339 (Fatal error then try to call 404 on production with activated cache)

You must first sign up to be able to contribute.

Ticket #8339 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Fatal error then try to call 404 on production with activated cache

Reported by: leopard Assigned to: fabien
Priority: minor Milestone: 1.3.4
Component: controller Version: 1.4.2
Keywords: 404 page, cache Cc:
Qualification: Unreviewed

Description

Symfony 1.4.2

Project on production. Activate cache system. Try to call 404 page (error_404_module and error_404_action is set and exist). In syslog I see this errors:

Feb 25 01:09:08 leoserver apache2: Empty module and/or action after parsing the URL "/asdasd" (/). Feb 25 01:09:08 leoserver apache2: PHP Fatal error: Uncaught exception 'sfException' with message 'A cache key must contain both a module and an action parameter' in /var/www/clients/client2/web6/lib/vendor/symfony/lib/view/sfViewCacheManager.class.php:246#012Stack trace:#012#0 /var/www/clients/client2/web6/lib/vendor/symfony/lib/view/sfViewCacheManager.class.php(145): sfViewCacheManager->convertParametersToKey(Array)#012#1 /var/www/clients/client2/web6/lib/vendor/symfony/lib/view/sfViewCacheManager.class.php(478): sfViewCacheManager->ge

How to resolve this error?

Change History

03/06/10 13:32:31 changed by leopard

Ok, I found you problem. This begin, the use cache with contextual parametr. This fix error:

Index: lib/view/sfViewCacheManager.class.php
===================================================================
--- lib/view/sfViewCacheManager.class.php       (revision 28275)
+++ lib/view/sfViewCacheManager.class.php       (working copy)
@@ -142,6 +142,10 @@
       if (!$contextualPrefix)
       {
         list($route_name, $params) = $this->controller->convertUrlStringToParameters($this->routing->getCurrentInternalUri());
+       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

03/23/10 16:19:09 changed by fabien

  • status changed from new to closed.
  • resolution set to fixed.
  • milestone set to 1.3.4.

in r28714