-
-
Save dsueiro/7a727c9e067b99651d13a15c5587eab4 to your computer and use it in GitHub Desktop.
cms block fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/code/core/Mage/Cms/Block/Block.php b/app/code/core/Mage/Cms/Block/Block.php | |
index bc81de3..a0dce44 100755 | |
--- a/app/code/core/Mage/Cms/Block/Block.php | |
+++ b/app/code/core/Mage/Cms/Block/Block.php | |
@@ -72,4 +72,24 @@ protected function _toHtml() | |
} | |
return $html; | |
} | |
+ | |
+ /** | |
+ * Retrieve values of properties that unambiguously identify unique content | |
+ * | |
+ * @return array | |
+ */ | |
+ public function getCacheKeyInfo() | |
+ { | |
+ $blockId = $this->getBlockId(); | |
+ if ($blockId) { | |
+ $result = array( | |
+ 'CMS_BLOCK', | |
+ $blockId, | |
+ Mage::app()->getStore()->getCode(), | |
+ ); | |
+ } else { | |
+ $result = parent::getCacheKeyInfo(); | |
+ } | |
+ return $result; | |
+ } | |
} | |
diff --git a/app/code/core/Mage/Cms/Block/Widget/Block.php b/app/code/core/Mage/Cms/Block/Widget/Block.php | |
index 2352be7..df1b332 100644 | |
--- a/app/code/core/Mage/Cms/Block/Widget/Block.php | |
+++ b/app/code/core/Mage/Cms/Block/Widget/Block.php | |
@@ -82,10 +82,26 @@ protected function _beforeToHtml() | |
$helper = Mage::helper('cms'); | |
$processor = $helper->getBlockTemplateProcessor(); | |
$this->setText($processor->filter($block->getContent())); | |
+ $this->addModelTags($block); | |
} | |
} | |
unset(self::$_widgetUsageMap[$blockHash]); | |
return $this; | |
} | |
+ | |
+ /** | |
+ * Retrieve values of properties that unambiguously identify unique content | |
+ * | |
+ * @return array | |
+ */ | |
+ public function getCacheKeyInfo() | |
+ { | |
+ $result = parent::getCacheKeyInfo(); | |
+ $blockId = $this->getBlockId(); | |
+ if ($blockId) { | |
+ $result[] = $blockId; | |
+ } | |
+ return $result; | |
+ } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment