Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Just spent a few hours looking into this. The problem is that for good reason the page cache doesn't load the page layout, which means that Mage_Catalog_Block_Breadcrumbs->_prepareLayout() doesn't get called when the page cache attempts to reload the cache for this block. _prepareLayout() is what loads the breadcrumb before calling Mage_Page_Block_Html_Breadcrumbs->_toHtml()</p> <p>A quick way to replicate the problem with full page cache that is saved to the file system is to:</p> <ol> <li>Go to a product or category page</li> <li>Flush the full page cache</li> <li>Go into /var/full_page_cache and search for the folder containing two files that look like "%CONTAINER_BREADCRUMBS%" and delete them</li> </ol> <p>This will require that the page cache attempt to reload just that block. Since the load doesn't call Mage_Catalog_Block_Breadcrumbs->_prepareLayout() the call to Mage_Page_Block_Html_Breadcrumbs->_toHtml() returns an empty string and the new cache files are empty until cache is completely purged and the full page is reloaded.</p> <p>The fix I came up with for this isn't pretty, but it seemed to be the least invasive. Simply create a block override for the _toHtml() method that does what _prepareLayout() does.</p> <pre><code>class Package_Module_Block_Html_Breadcrumbs extends Mage_Page_Block_Html_Breadcrumbs { protected function _toHtml() { if (!is_array($this-&gt;_crumbs)) { $this-&gt;addCrumb('home', array( 'label'=&gt;Mage::helper('catalog')-&gt;__('Home'), 'title'=&gt;Mage::helper('catalog')-&gt;__('Go to Home Page'), 'link'=&gt;Mage::getBaseUrl() )); $path = Mage::helper('catalog')-&gt;getBreadcrumbPath(); foreach ($path as $name =&gt; $breadcrumb) { $this-&gt;addCrumb($name, $breadcrumb); } } return parent::_toHtml(); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload