magefan / module-blog

Magento 2 Blog Extension is a solution that helps you to create a blog on Magento and manage posts,categories, tags, authors, and comments.
https://magefan.com/magento2-blog-extension
Other
265 stars 136 forks source link

Version 2.9.4 breaks the Latest Blog Post widget #325

Closed DrVolt closed 4 years ago

DrVolt commented 4 years ago

After upgrading to version 2.9.4 the Latest Blog Post widget breaks generating this error in the front end: 'We're sorry, an error has occurred while generating this content.'

and this error in the Magento's exception.log file: [2020-06-29 15:52:37] main.CRITICAL: Invalid method Magefan\Blog\Block\Widget\PostList::isShow {"exception":"[object] (Magento\\Framework\\Exception\\LocalizedException(code: 0): Invalid method Magefan\\Blog\\Block\\Widget\\PostList::isShow at /var/www/vhosts/j702.vertigonet.it/httpdocs/vendor/magento/framework/DataObject.php:399)"} []

The errors happens both on a demo site running Magento 2.3.3 https://j702.vertigonet.it/ and on an upgraded site running Magento 2.3.5-p1 with the same template, both running PHP 7.3

The widget in the demo is configured this way:

<div class="cdz-blog-wrap post-list-style05">
<div class="cdz-block-title">
<p class="b-title h2">Last Blog Posts</p>
</div>
<div class="cdz-block-content">{{widget type="Magefan\Blog\Block\Widget\PostList" categories="3,4,5,6" order_by="publish_time" order="desc" post_count="6" show_in_front="featured_img,title,short_content,publish_time,author,category" desc_length="65" date_format="M d Y" thumb_width="276" thumb_height="184" post_template="custom" custom_template="post/widget/grid-style-05.phtml" total_rows="1" total_cols="6" show_slider="1" slider_dots="0" slider_nav="1" slider_margin="20" items_1900="5" items_1600="5" items_1420="5" items_1280="5" items_980="4.5" items_768="3.5" items_480="2.5" items_320="1.5" items_0="1"}}</div>
</div>
<p>&nbsp;</p>
<p></p>
ihorvansach commented 4 years ago

@DrVolt , thank you for your report.

Looks like you use Fastest theme for Magento 2, or maybe some-other. It ads custom file to the blog extension. We have added it to the blog extension a few release ago (https://github.com/magefan/module-blog/blob/master/Block/Widget/PostList.php) as some customers complained that it is missing after the update. But looks like now they added some new methods to this file.

Could you please get a file app/code/Magefan/Blog/Block/Widget/PostList.php from your theme archive and share it's code, so we can update it in our repo?

DrVolt commented 4 years ago

Thank you @ihorvansach for pointing me in the right direction. After updating to the latest version of the Infinit template, everything went back to normal. Attached is the working file from the template PostList-codazon-latest.zip

magefan commented 4 years ago

@DrVolt , thank you. We have updated this file in our codebase. It will be included in the next release. Commit: https://github.com/magefan/module-blog/commit/771b9bc915561a5516c5b660702af0ac837d83c2