Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Category name in page header #1524

Open
jtomka opened this issue Nov 11, 2018 · 1 comment
Open

Category name in page header #1524

jtomka opened this issue Nov 11, 2018 · 1 comment

Comments

@jtomka
Copy link

jtomka commented Nov 11, 2018

(This is pretty much a duplicate of #720 which was never resolved.)

I'm having a hard time getting category name and/or image displayed in page header.

Relevant sections of the layout:

    <default>
        <reference name="header">
            <block type="core/text_list" name="bm3-banner-section-bg" translate="label" module="page">
                <label>Banner Section Background</label>
            </block>

            <block type="core/text_list" name="bm3-page-title-box" translate="label" module="page">
                <label>Page Title Box</label>
            </block>
    </default>

    <_bm3_catalog_category_common>
        <reference name="bm3-banner-section-bg">
            <block type="catalog/category_view" name="category-banner-bg" template="catalog/category/view/banner.bg.phtml" />
        </reference>

        <reference name="bm3-page-title-box">
            <block type="catalog/category_view" name="category-title-box" template="catalog/category/view/title.box.phtml" />
        </reference>
    </_bm3_catalog_category_common>

    <catalog_category_default>
        <update handle="_bm3_catalog_category_common" />
    </catalog_category_default>

    <catalog_category_layered>
        <update handle="_bm3_catalog_category_common" />
    </catalog_category_layered>

All working fine without Varnish. No matter what I do, after enabling Varnish 4.0 + Turpentine, I'm getting the following errors for those blocks:

PHP Fatal error:  Call to a member function getImageUrl() on null in app/design/frontend/bm3/default/template/catalog/category/view/banner.bg.phtml
PHP Fatal error:  Call to a member function getDescription() on null in app/design/frontend/bm3/default/template/catalog/category/view/title.box.phtml

This is with both the default Turpentine layout XML, and with the following ESI options for those blocks (and many other combinations):

<access>public</access>
<scope>page</scope>
<registry_keys>
  <current_category />
</registry_keys>

Thanks for any help.

@jtomka
Copy link
Author

jtomka commented Nov 13, 2018

One interesting thing I noticed in the logs. When the cache is flushed, I get two references to each of those blocks in the logs, with the second one missing the Esi Options. Once cached, only the second, with missing Esi Options, shows up in the log before the Fatal PHP error:

==> var/log/system.log <==
TURPENTINE: Checking ESI block candidate: category-banner-bg
TURPENTINE: -- block testing: shouldResponseUseEsi = 1
TURPENTINE: -- block testing: instanceof Mage_Core_Block_Template = 1
TURPENTINE: -- block testing: Esi Options = Array
(   
    [access] => public
    [scope] => page                                                                                               [registry_keys] => Array                                                                                          (                                                                                                                 [current_category] =>
        )

)
                                                                                                              TURPENTINE: Block check passed, injecting block: category-banner-bg                                            
[..]

TURPENTINE: Checking ESI block candidate: category-banner-bg 
TURPENTINE: -- block testing: shouldResponseUseEsi = 1
TURPENTINE: -- block testing: instanceof Mage_Core_Block_Template = 1
TURPENTINE: -- block testing: Esi Options =

==> /var/log/apache2/error.log <==
PHP Fatal error:  Call to a member function getImageUrl() on null in app/design/frontend/bm3/default/template/catalog/category/view/banner.bg.phtml on line 11

Same thing seems to be happening on the search result page where the <dummy_block><head /></dummy_block> doesn't seem to have any effect and I'm getting the following error on $this->getLayout()->getBlock('head')->setTitle($title);:

PHP Fatal error:  Call to a member function setTitle() on boolean in app/code/core/Mage/CatalogSearch/Block/Result.php on line 78

Is there anything that could be removing the Esi Options and/or preventing both the <registry_keys> and <dummy_blocks> from working? Thanks.

@miguelbalparda miguelbalparda added old-invalid Issues created before 2018-01-01. Will close en mass on Feb 15. and removed old-invalid Issues created before 2018-01-01. Will close en mass on Feb 15. labels Feb 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants