0

I facing issue described Here

I added the code to app/code/core/Mage/Cms/Block/Block.php at line 72:

and into

In app/code/core/Mage/Cms/Block/Widget/Block.php at line 82:

But someone also stated that:

(int)Mage::app()->getStore()->isCurrentlySecure()

Needs to be added in order to solve the issue completely, I just can't figure out in which file and where it needs to be added.

Could someone please help me out?

Thanks in advance.

user20620
  • 23
  • 4

2 Answers2

1

This is what my free extension does. That is it will cache magento static block by considering store, cms tag, block identifier, secure or not. Please have a look or you can install it.

For more info, please have look at here

Rajeev K Tomy
  • 17,234
  • 6
  • 61
  • 103
0

Looking at the original issue you need to add the isCurrentlySecure() call within the $result array of both changes.

app/code/core/Mage/Cms/Block/Block.php

             }
         return $html;
     }
+
+    /**
+     * Retrieve values of properties that unambiguously identify unique content
+     *
+     * @return array
+     */
+    public function getCacheKeyInfo()
+    {
+        $blockId = $this->getBlockId();
+        if ($blockId) {
+            $result = array(
+                $blockId,
+                Mage::app()->getStore()->getCode(),
                 (int)Mage::app()->getStore()->isCurrentlySecure()
+            );
+        } else {
+            $result = parent::getCacheKeyInfo();
+        }
+        return $result;
+    }
 }

app/code/core/Mage/Cms/Block/Widget/Block.php

$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;
+            $result[] = (int)Mage::app()->getStore()->isCurrentlySecure();
+        }
+        return $result;
+    }
 }
Dave
  • 872
  • 6
  • 16