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.
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
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!