From e8fb3dd77a81c89d611976968aca38a01d85843d Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Tue, 12 Jun 2012 12:56:23 +0200 Subject: [PATCH] Fix metadata cache --- lib/classes/caption/Field/Value.class.php | 10 +++++++++- lib/classes/caption/field.class.php | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/classes/caption/Field/Value.class.php b/lib/classes/caption/Field/Value.class.php index bdd5468121..3223605dce 100644 --- a/lib/classes/caption/Field/Value.class.php +++ b/lib/classes/caption/Field/Value.class.php @@ -408,6 +408,8 @@ class caption_Field_Value implements cache_cacheableInterface $record->get_caption()->delete_data_from_cache(); $databox_field->delete_data_from_cache(); + $caption_field_value->delete_data_from_cache(); + return $caption_field_value; } @@ -534,7 +536,7 @@ class caption_Field_Value implements cache_cacheableInterface */ public function get_cache_key($option = null) { - return 'caption_fieldvalue_' . $this->id . '_' . $this->record->get_serialize_key() . ($option ? '_' . $option : ''); + return 'caption_fieldvalue_' . $this->id . '_' . ($option ? '_' . $option : ''); } /** @@ -575,6 +577,12 @@ class caption_Field_Value implements cache_cacheableInterface { $databox = $this->record->get_databox(); $this->value = $this->VocabularyId = $this->VocabularyType = null; + + try { + $this->record->get_caption()->get_field($this->databox_field->get_name())->delete_data_from_cache(); + } catch (\Exception $e) { + + } return $databox->delete_data_from_cache($this->get_cache_key($option)); } diff --git a/lib/classes/caption/field.class.php b/lib/classes/caption/field.class.php index 00e142c0fe..b605336ed0 100644 --- a/lib/classes/caption/field.class.php +++ b/lib/classes/caption/field.class.php @@ -463,7 +463,7 @@ class caption_field implements cache_cacheableInterface */ public function get_cache_key($option = null) { - return 'caption_field_' . $this->record->get_serialize_key() . ($option ? '_' . $option : ''); + return 'caption_field_' . $this->databox_field->get_id() . '_' . $this->record->get_serialize_key() . ($option ? '_' . $option : ''); } /**