Skip Navigation

[Closed] Views cache invalidator not compatible with PHP 8.3

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.

This topic contains 5 replies, has 1 voice.

Last updated by Christopher Amirian 1 week, 6 days ago.

Assisted by: Christopher Amirian.

Author
Posts
#2807373

Hi,

I'm using views shortcodes on pages in the classic editor. When saving a page, the following error is shown:

Uncaught Error: array_intersect(): Argument #1 ($array) must be of type array, string given
in /var/www/html/wp-content/plugins/wp-views/application/controllers/cache/views/invalidator.php on line 274

Call stack:

array_intersect()
wp-content/plugins/wp-views/application/controllers/cache/views/invalidator.php:274
OTGS\T\V\C\C\V\Invalidator::invalidate_cache_per_domain()
wp-content/plugins/wp-views/application/controllers/cache/views/invalidator.php:217
OTGS\T\V\C\C\V\Invalidator::should_invalidate_cache()
wp-includes/class-wp-hook.php:324
WP_Hook::apply_filters()
wp-includes/class-wp-hook.php:348
WP_Hook::do_action()
wp-includes/plugin.php:517
do_action()
wp-includes/load.php:1304

Warning: Undefined array key "file" in /var/www/html/wp-content/plugins/query-monitor/dispatchers/Html.php on line 1022

Warning: Undefined array key "line" in /var/www/html/wp-content/plugins/query-monitor/dispatchers/Html.php on line 1022
shutdown_action_hook()

The page is still saved correctly.

Best regards
Matthias

#2807396

Christopher Amirian
Supporter

Languages: English (English )

Hi,

Welcome to Toolset support. I wonder if the same cache related issue happens on a minimal installation?

- IMPORTANT STEP! Create a backup of your website. Or better approach will be to test this on a copy/staging version of the website to avoid any disruption of a live website.
- Switch to the default theme such as "TwentyTwenty" by going to "WordPress Dashboard > Appearance > themes".
- Go to "WordPress Dashboard > Plugins" and deactivate all plugins except Toolset and its add-ons.
- Check if you can still recreate the issue.
- If not, re-activate your plugins one by one and check the issue each time to find out the plugin that causes the problem.

And I wonder if you checked to see if it works in PHP versions prior to 8.3?

Thanks.

#2807411

Hi Christopher,

I have very interesting news! Using the "Healthcheck & Troubleshooting" plugin I deactivated all plugins except Types, Views and Classic Editor and switched to a default theme. Saving a page was possible without an error. But when I activated the Query Monitor plugin (https://wordpress.org/plugins/query-monitor/) and tried to save the page again, the error appeared again.

So it looks like there's an incompatibility between Views and Query Monitor. Are you able to reproduce this?

With PHP 8.2 it works fine.

Best regards
Matthias

#2807490

Christopher Amirian
Supporter

Languages: English (English )

Thank you Matthias,

Query Monitor is a debugging plugin and such scenarios might happen. But I think it merits a report to our development team.

I'm glad that you managed to find the culprit, at least you will now be able to work with Toolset and when needed you can enable Query Monitor when specifically you want to use it for testing.

The other point is also that PHP 8.3 is a version that is not fully tested yet so for now I do suggest that you either keep 8.2 or deactivate Query Monitor on view save on 8.3

One last point to check with you is that I wonder if this happens on any sort of View using the legacy mode or a specific one? I created a clean installation of WordPress and Toolset. Maybe you can add a view there that you know it will cause the issue:

hidden link

(Unfortunately, I could not find PHP 8.3 on our server to test)

Thanks.

#2807780

Hello Christopher,

the website, where I found this issue, is using about 70 views and a lot of these get cached (but not all). I'm not sure, which one does cause the cache invalidator issue. I tried to reproduce the issue on a clean installation with PHP 8.3 and Types & Views but I was not able to get views data (custom fields) get cached. Maybe I don't have enough data in the test installation.

As the error only occures with PHP 8.3 I think it's not helpful to try to reproduce it on your PHP 8.2 test instance.

What do you think when the Toolset plugins will be fully PHP 8.3 ready? A lot of webhosters already recommend PHP 8.4.

Best regards
Matthias

#2807818

Christopher Amirian
Supporter

Languages: English (English )

Hi Matthias,

It will be a matter of time, we can not give an ETA as WordPress itself is still in Beta Compatible mode with PHP 8.3:

https://make.wordpress.org/hosting/handbook/server-environment/

The first step is to have WordPress official compatibility to go forward as we use heavily WordPress native functionality.

Thanks.

The topic ‘[Closed] Views cache invalidator not compatible with PHP 8.3’ is closed to new replies.