Zend Framework

Same cache in Zend_Paginator for different items

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 1.10.5
  • Fix Version/s: 1.11.0
  • Component/s: Zend_Paginator
  • Labels:
    None

Description

In release 1.10.5 the following code in Zend_Paginator was changed:

return md5(serialize($this->getAdapter()) . $this->getItemCountPerPage());

to

return md5(serialize(array(
       get_class($this->getAdapter()),
       $this->getItemCountPerPage()
)));

This assumes that a Zend_Paginator_Adapter class is used only once in the whole application. I'm using a modified version of the DbSelect adapter so that the adapter is loaded with different Zend_Db_Select objects. But with the current caching implementation, this always leads to the same cache id because only the class name and the item counter are serialized which are the same for all objects.

Activity

Hide
Nicolas Ruflin added a comment -

Ok, I didn't check the actual source code. Thanks for the fix.

Show
Nicolas Ruflin added a comment - Ok, I didn't check the actual source code. Thanks for the fix.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: