From 032b87dc8888bcb6f2e090a24708e474453e9e06 Mon Sep 17 00:00:00 2001
From: Vincent Pelletier <vincent@nexedi.com>
Date: Fri, 21 Feb 2014 14:28:41 +0100
Subject: [PATCH] ERP5Form: Do not bump field cache cookie on each miss.

On sites with more than one Zope, this code was causing the cookie to be
bumped each time a form is rendered, causing unneeded cache misses and
slight ZODB bloat (estimated around 100B per form view).
---
 product/ERP5Form/Form.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/product/ERP5Form/Form.py b/product/ERP5Form/Form.py
index 882653ac48..46d71bade9 100644
--- a/product/ERP5Form/Form.py
+++ b/product/ERP5Form/Form.py
@@ -74,7 +74,7 @@ class FieldValueCacheDict(dict):
       if cookie != self._last_sync:
         LOG("ERP5Form.Form", 0, "Resetting form field value cache")
         self._last_sync = cookie
-        self.clear()
+        super(FieldValueCacheDict, self).clear()
         raise KeyError('Field cache is outdated and has been reset')
 
     return super(FieldValueCacheDict, self).__getitem__(cache_id)
-- 
2.30.9