Skip Navigation

[Resolved] PHP 8 "There has been a critical error on this website." wpv_filter_parse_date

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 6.68 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Waqar 11 months, 2 weeks ago.

Assisted by: Waqar.

Author
Posts
#2672085
Larry Daniele - Toolset View error - screen capture of error on page.jpg
Larry Daniele - Toolset View error - call stack.jpg
Larry Daniele - Toolset View error - exception.jpg

I am trying to:

Upgrade site to PHP 8.

Link to a page where the issue can be seen:

hidden link

I expected to see:

Page as you see it now.

Instead, I got:

Partial page with "There has been a critical error on this website." where the View should be when running PHP 8.2.

I've loaded the site locally and have traced the bug to "function wpv_filter_parse_date($date_format)" in "wp-content/plugins/types/vendor/toolset/toolset-common/inc/toolset.function.helpers.php".

Specifically, all the case statements in the switch that try to use the "+" operator on two strings. For example:

case "FUTURE_DAY":
$resulting_date = adodb_mktime(0, 0, 0, date_i18n('m'), date_i18n('d') + $date_value, date_i18n('Y'));
break;

The internal error is:

Type Error: Unsupported Operand Types: string + string

date_i18n() returns a string and $date_value is the string "wpv-wpcf-expiration-date", so this code (or the args) is wrong.

If I comment out the "+ $date_value" part of the statement, then the code runs fine and the View is displayed as expected.

#2672455

Hi,

Thank you for contacting us and I'd be happy to assist.

I tried to view the page's content, but Wordfence is restricting the page's access.

An error like this can show if one of the date types fields or filters doesn't have the value in the correct/recognizable date format.

If you're using a view on this page, can you please check if all the posts showing as results have the correct date values stored in any date-type field?

In case the issue persists, you're welcome to share a clone/snapshot of the website, so we can investigate this on a different server.
( ref: https://toolset.com/faq/provide-supporters-copy-site/ )

Let me know how it goes and I'm setting your next reply as private.

regards,
Waqar

#2672811

I was able to resolve this problem by changing the existing View "Custom field filter" rule from:

Expiration Date is a number greater than or equal FUTURE_DAY(wpv-wpcf-expiration-date)

to:

Expiration Date is a number greater than or equal TODAY()

Waqar, thanks for your clue to look in this direction!