Error in post preview

Posted in: Newspaper
Post count: 2

I have got following error only when I preview post. Newspaper theme version: 10.0.2

Fatal error: Uncaught Error: Call to a member function format() on bool in wp-content/plugins/td-composer/legacy/common/wp_booster/td_module_single_base.php:672

Post count: 68

Same here. Can’t preview, fatal error.

Post count: 2

Same problem, Waiting for bug fixing from TagDiv Team.

Post count: 18

I have the same problem on version 10.2, why is no one working on it šŸ™

Post count: 18283

Hello !

Please de-activate the schema articles from here: https://www.screencast.com/t/0E3IucACC You will have to check that in order to deactivate the schema, this issue will be fixed in the next update.

Thank you for your understanding !

Post count: 2

I’ve done but nothing is changed.

Post count: 2

That is the solution:

// datePublished
$td_article_date_unix = get_post_datetime( $this->post, ‘date’, ‘gmt’ );
if ($td_article_date_unix)
$buffy .= ‘<meta itemprop=”datePublished” content=”‘ . $td_article_date_unix->format( DATE_W3C ) . ‘”>’;

// dateModified – local time
$td_article_modified_date_unix = get_post_datetime( $this->post, ‘modified’, ‘gmt’ );
if ($td_article_modified_date_unix)
$buffy .= ‘<meta itemprop=”dateModified” content=”‘ . $td_article_modified_date_unix->format( DATE_W3C ) . ‘”>’;

lines: 670 – 678.

Function get_post_datetime returns false when post’s datetime is not set (that’s why this error occurs only in preview mode). And then you call format() method on boolean value: $td_article_date_unix->format.

Please fix it in next release.

Post count: 18283

Hello !

Please let us know a bit more details. What are the exact steps that you follow to encounter this issue. We tested this on 10.2 and everything works fine. There may be a plugin conflict but let us know what are the steps you take so we can follow and see the issue.

Thank you !

Post count: 23

Hello!

I disabled the schema article as you said, Vlad. It works fine now. I encountered the problem when I clicked on preview on a not published post.

Thank you,

Viewing 9 posts - 1 through 9 (of 9 total)
The forum ‘Newspaper’ is closed to new topics and replies.