nexcess / magento-turpentine

A Varnish extension for Magento.
GNU General Public License v2.0
519 stars 253 forks source link

$this->getLayout->getBlock('myBlock') return false #1520

Open ghost opened 5 years ago

ghost commented 5 years ago

I can't get block from layout

Layout for Page customer dashboard:

<customer_account_index>
    <turpentine_cache_flag value="0" />
</customer_account_index>

in my template file, I have a statement:

$myBlock = $this->getLayout->getBlock('myBlock'); // $myBlock: false;
$links = $myBlock->getLinks(); // (!) Fatal error: Call to a member function getLinks() on boolean

Header response:

Accept-Ranges: bytes
Age: 0
Cache-Control: no-store, no-cache, must-revalidate
Connection: keep-alive
Content-Encoding: gzip
Content-Type: text/html; charset=UTF-8
Date: Fri, 26 Oct 2018 01:35:40 GMT
Server: nginx
Transfer-Encoding: chunked
Vary: X-UA-Device, Accept-Encoding
Via: 1.1 varnish-v4
X-Frame-Options: SAMEORIGIN
X-Turpentine-Cache: 0
X-Turpentine-Esi: 1
X-UA-Device: pc
X-Varnish: 229441
X-Varnish-Currency: 
X-Varnish-Esi-Access: 
X-Varnish-Esi-Method: 
X-Varnish-Hits: 0
X-Varnish-Host: example.local
X-Varnish-Set-Cookie: frontend=t7ie7hf8e57b3t5ptq1ved5mg0; expires=Sun, 25-Nov-2018 01:35:38 GMT; Max-Age=2592000; path=/; domain=example.local; httponly
X-Varnish-Store: 
X-Varnish-URL: /customer/account/

Environment:

Varnish: 4.1 Turpentine: 0.7.4

nstojadinovicwst commented 5 years ago

getLayout() maybe?