CreateIT
CreateIT
BLOG

Website malfunction after the use of Pods plugin

TAGS:

Website malfunction after the use of Pods plugin

SHARE

CHALLENGE:
After Pods plugin update (to version 2.7.21), page listings stopped rendering. The first element without an added feature was causing the page to crash.
SOLUTION:
Add [if post_thumbnail][/if] to Pod Templates

Pods is a content development framework for WordPress that you can use to create, manage and implement custom content – all in one place. It allows you both to create completely new material and to further customize the content that already exists. With an average rating of 4.9/5, it has become the favorite plugin for many creators.

Despite the positive reviews of Pods, you may still encounter a problem with page listings. If you do, don’t worry – we have a solution for you.

After routine WordPress plugin updates, we’ve noticed that some subpages are broken. HTTP response status code was still correct (200), but listing suddenly stopped rendering. A close look at source-view HTML showed:

(...)
<article id="post-393" class="post-393 page type-page status-publish hentry">
<div class="entry-content">
<div class="list-item-element">
<div class="list-item-wrapper">
<a class="list-thumbnail" href="/news/title-123/">
<img src="/wp-content/uploads/2019/03/logo.jpg" />
<h4 class="list-title">Title 123</h4>
</a>
</div>
</div>
(...) END of output

We enabled WP-DEBUG Log to check if there are any PHP errors. We added the following solution to wp-conifg.php :

// define('WP_DEBUG', false);
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', 'wp-content/ct_debugging.log');
define( 'WP_DEBUG_DISPLAY', false );

However, the error log didn’t show any critical errors. We had to conduct a more in-depth investigation: listings are rendered by wordpress plugin: Pods – Custom Content Types and Fields 2.7.21.
In Wp-admin / Pods Admin / Pod Templates / news-root there was the following template:

[before]
<div class="main-list">
[/before]
<div class="list-item-element">
<div class="list-item-wrapper">
<a class="list-thumbnail" href="{@permalink}">
<img src="{@post_thumbnail_url.full}" />
<h4 class="list-title">{@post_title}</h4>
</a>
</div>
</div>
[after]
</div>
[/after]

The bug was caused by {@post_thumbnail_url.full} in a situation when the “featured image” wasn’t added to the news. In the previous plugin version, it was working totally fine.

Solution

We introduced special tags into the template: [if post_thumbnail][/if]
After adding those, the page started to work correctly again.

[before]
<div class="main-list">
[/before]
<div class="list-item-element">
<div class="list-item-wrapper">
<a class="list-thumbnail" href="{@permalink}">
[if post_thumbnail] <img src="{@post_thumbnail_url.full}" />[/if]
<h4 class="list-title">{@post_title}</h4>
</a>
</div>
</div>
[after]
</div>
[/after]

 

Update

Some time later, the bug was fixed in the next plugin release (2.7.22). More info here: https://github.com/pods-framework/pods/pull/5805
= 2.7.22 – August 13th 2020 =
**Bug Fixes**
* Fixed: Prevent fatal errors about memory when using certain magic tag / thumbnail combinations. #5805 (@JoryHogeveen)

 

___

About the article Author:

Maciej Brzeziński

Techleader of createIT, working in the IT sector for over 14 years. Innovator, author, and owner of an e-shop that he has been continuously developing for over 10 years. Currently, with his team of over 20 developers, he supervises all kinds of e-commerce projects of varied structure, characteristics, and size: from simple on-line shops for retail clients to advanced B2B platforms with support of multiple shopping carts, multiple languages, and integration with external systems. His work also involves modifying and expanding the existing platforms with millions of products in their databases, platforms that support variable pricing (several variants of the same product), dropshipping modules, integration with storage systems, integration with courier delivery services, and the last but not least, the optimization of scripts. By participating in a multitude of projects, he had the opportunity to “test out” all kinds of platforms (open-source, SaaS – Cloud-Hosted eCommerce Platforms) and dedicated platforms.

About us:

Hi, we are createIT!

As a passionate group of professionals with a love for Web and mobile technologies, we have been successfully serving our clients for the past 15 years. Through these years we have continuously striven to create the best IT solutions our clients seek.

Our 70+ developer team creates cutting-edge complex B2B and B2C web systems and apps as well as delivers top-notch direct outsourcing services.

We work in multiple frameworks but we hold special feelings and are experts in PHP (Symfony, OXID, WordPress), JavaScript (React, AngularJS), Flutter and Blockchain. We do enjoy working in the scalable cloud environment like AWS.

We are located in Warsaw, Poland, in the heart of Europe. Concentrated on delivering durable web solutions of high integrity, we do not always try to be the cheapest. However, thanks to our location you will be surprised how reasonable our prices are.

Fluent in English we offer services worldwide. Among others, in countries such as the U.S.A., Great Britain, Germany, Australia, Sweden and Poland.

Popular News

Need help?

  • Looking for support from experienced programmers?

  • Need to fix a bug in the code?

  • Want to customize your webste/application?

ADD COMMENT

Your email address will not be published. Required fields are marked *

createIT Contact