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

_addBreadcrumbs error on Posts page #13

Closed
chris-brabender opened this issue Mar 9, 2016 · 9 comments
Closed

_addBreadcrumbs error on Posts page #13

chris-brabender opened this issue Mar 9, 2016 · 9 comments

Comments

@chris-brabender
Copy link

chris-brabender commented Mar 9, 2016

After a fresh installation of the blog module, I added a new category to get it all to display.

The home page for the blog loads fine, and so does the category page. The hello world post displays in on both pages but clicking in to view the post results in this error:

Recoverable Error: Argument 1 passed to Magefan\Blog\Block\Post\View::_addBreadcrumbs() must be an instance of Magefan\Blog\Model\Post, null given, called in vendor/magefan/module-blog/Block/Post/View.php on line 25 and defined in vendor/magefan/module-blog/Block/Post/View.php on line 41

Changing:

$post = $this->getPost();

To:

$post = $this->_post;

Temporarily fixes the problem for me but it appears the execute() function in the Controller\Post\View action is not being triggered.

@chris-brabender
Copy link
Author

It's weird, this happens on our local environment but not on our development servers. I'll keep looking into this myself and see what I can find.

@magefan
Copy link
Owner

magefan commented Mar 14, 2016

@chris-brabender
Copy link
Author

yep these files are identical

@magefan
Copy link
Owner

magefan commented Mar 21, 2016

Chris, could you please contact to our support via email: support@magefan.com
We cannot reproduce this issue on our side.

@magefan magefan closed this as completed Apr 17, 2016
@Sanuch
Copy link

Sanuch commented Apr 23, 2016

It happens when we use varnish. Magento prepares esi call ProcessLayoutRenderElement.php#L55-L62 for varnish.
When we receive request /page_cache/block/esi/blocks/[%22catalog.topnav%22]/handles/[%22default%22,%22blog_post_view%22]/ then your module does not know about current post

@magefan magefan reopened this Apr 30, 2016
@magefan
Copy link
Owner

magefan commented May 2, 2016

Sanuch, please try the last fix

@Sanuch
Copy link

Sanuch commented May 4, 2016

Hi @magefan,
It works

@chris-brabender
Copy link
Author

chris-brabender commented May 4, 2016

@magefan thanks for these updates, could you possibly add a new tag so we can pull these down?

@magefan
Copy link
Owner

magefan commented May 4, 2016

@chris-brabender the tag will be available soon

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

4 participants
@Sanuch @chris-brabender @magefan and others