Hello all!

I'm going to open a ticket on this, but first I wanted to discuss the
possible solutions with you.

When the request parameters are modified during the action execution
using $request->setParameter() and the page cache is enabled, a notice
is thrown on sfCacheFilter:Line 118

115    $uri = sfRouting::getInstance()->getCurrentInternalUri();
116
117    // save page in cache
118    if ($this->cache[$uri]['page'])
119    {

This is because the "current internal uri" contains the request
parameters, and $this->cache[$uri] is defined before action execution,
thus before the request parameters are modified. A solution is to
enclose the whole if-statement from line 118 to 138 in another if
statement checking whether the array index $uri actually exists:

118    if(array_key_exists($uri, $this->cache)
119    {
120      if($this->cache[$uri]['page'])
121-137  ...
138      }
139    }

Another option would be to store the internal uri _before_ executing the
action and use that for the cache settings later on.

A third option would be to check whether the uri has been modified
during action execution and if yes, throw a ConfigurationException
informing the user to turn off the cache when modifying the request
parameters (as the page won't be cached anyway, if he does so).

What do you think about this? I can provide a patch, but first I need to
know about your thoughts.


Regards


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony developers" 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-devs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to