Skip Navigation

[Resolved] Toolset array_intersect Warning filling error log

This support ticket is created 3 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. 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: Africa/Casablanca (GMT+01:00)

This topic contains 5 replies, has 2 voices.

Last updated by sarahP 3 years, 1 month ago.

Assisted by: Jamal.

Author
Posts
#2191165

I recently manually moved a site from a Multisite installation to local (I exported/imported Toolset), and then moved the entire database and site files onto its own cPanel. Now, my error log is filling with the following Warning. Seems to happen when I edit any content, whether it is using toolset or not. The most recent time I was attempting to edit a blank post.

It happens when either Block or Views is enabled. Here's the error with Views enabled; with blocks enabled, it is the same error but says "toolset-blocks" instead of "views":
Warning: array_intersect(): Expected parameter 1 to be an array, string given in /home/site/public_html/wp-content/plugins/wp-views/application/controllers/cache/views/invalidator.php on line 274

I did not have this error when on multisite or on local. I am worried something got corrupted in the move and hope someone can help me fix it because as-is I can barely use my site....this issue is eating up my hosting resources and causing timeout errors if I am not careful.

Here is the stack trace:
1. array_intersect('', Array(2))/home/site/public_html/wp-content/plugins/wp-views/application/controllers/cache/views/invalidator.php:274
2. OTGS\Toolset\Views\Controller\Cache\Views\Invalidator->invalidate_cache_per_domain('posts', Array(3))/home/site/public_html/wp-content/plugins/wp-views/application/controllers/cache/views/invalidator.php:217
3. OTGS\Toolset\Views\Controller\Cache\Views\Invalidator->should_invalidate_cache('')/home/site/public_html/wp-includes/class-wp-hook.php:303
4. WP_Hook->apply_filters(null, Array(1))/home/site/public_html/wp-includes/class-wp-hook.php:327
5. WP_Hook->do_action(Array(1))/home/site/public_html/wp-includes/plugin.php:470
6. do_action('shutdown')/home/site/public_html/wp-includes/load.php:1097
7. shutdown_action_hook()

Any thoughts on what might be causing this?!

Thanks,
Sarah

#2191679

Hello Sara and thank you for contacting Toolset support.

Based on the stack trace it seems to me that is related to cache. Go through your views and disable cache on all of them, then check if the issue is resolved. If it does, reenable cache on the views that you want to cache and check if the issue is reproduced again or not.

If this does not help find the cause behind these warning, we'll need to take a copy of your website and check it further, let us know if that's fine with you.

#2193219

Hello Jamal,
Can you provide instructions on how to disable cache on my views?
On the Views admin page, I cleared the cache for each View. Is there somewhere else I can disable/reenable cache?

When I cleared cache on all views and opened a new post edit screen, the error did not recur, but now I get a bunch of errors (lots are "Cannot allocate memory") for various plugins (always some for Toolset) whenever I edit posts or content templates.

I will share some of the new errors related to Toolset in case you see a pattern or have some insight into what is causing these.

The first logged error after clearing the cache was related to Toolset in the stack trace:

Notice: require_once(): read of 15356 bytes failed with errno=12 Cannot allocate memory in /home/site/public_html/wp-content/plugins/jetpack/modules/module-extras.php on line 74
Stack Trace
1. require()/home/site/public_html/wp-content/plugins/wp-views/vendor/toolset/blocks/psr4-autoload.php:22
2. {closure}('ToolsetBlocks\Plugin\W...')
3. spl_autoload_call('ToolsetBlocks\Plugin\W...')
4. ReflectionClass->__construct('\ToolsetBlocks\Plugin\...')/home/site/public_html/wp-content/plugins/types/vendor/toolset/toolset-common/lib/auryn/lib/StandardReflector.php:14
5. OTGS\Toolset\Common\Auryn\StandardReflector->getCtor('\ToolsetBlocks\Plugin\...')/home/site/public_html/wp-content/plugins/types/vendor/toolset/toolset-common/lib/auryn/lib/CachingReflector.php:38
6. OTGS\Toolset\Common\Auryn\CachingReflector->getCtor('\ToolsetBlocks\Plugin\...')/home/site/public_html/wp-content/plugins/types/vendor/toolset/toolset-common/lib/auryn/lib/Injector.php:399
7. OTGS\Toolset\Common\Auryn\Injector->provisionInstance('\ToolsetBlocks\Plugin\...', 'toolsetblocks\plugin\w...', Array(0))/home/site/public_html/wp-content/plugins/types/vendor/toolset/toolset-common/lib/auryn/lib/Injector.php:373
8. OTGS\Toolset\Common\Auryn\Injector->make('\ToolsetBlocks\Plugin\...')/home/site/public_html/wp-content/plugins/wp-views/vendor/toolset/blocks/server/routes.php:86
9. ToolsetBlocks\{closure}('')/home/site/public_html/wp-includes/class-wp-hook.php:303
10. WP_Hook->apply_filters(null, Array(1))/home/site/public_html/wp-includes/class-wp-hook.php:327
11. WP_Hook->do_action(Array(1))/home/site/public_html/wp-includes/plugin.php:470
12. do_action('init')/home/site/public_html/wp-settings.php:578
13. require_once('/home/site/publi...')/home/site/public_html/wp-config.php:88
14. require_once('/home/site/publi...')/home/site/public_html/wp-load.php:50
15. require_once('/home/site/publi...')/home/site/public_html/wp-admin/admin-ajax.php:22

***************************************************************************************************************
Next, I opened a Content Template to edit, and again I got more errors. Here are some related to Toolset:

Fatal error: Uncaught Error: Class 'WPV_Shortcode_Post_Next_Link' not found in /home/site/public_html/wp-content/plugins/wp-views/application/controllers/main.php:156
Stack Trace
1. {anonymous}()/home/site/public_html/wp-content/plugins/wp-views/application/controllers/main.php:156
2. WPV_Main->on_init('')/home/site/public_html/wp-includes/class-wp-hook.php:303
3. WP_Hook->apply_filters(null, Array(1))/home/site/public_html/wp-includes/class-wp-hook.php:327
4. WP_Hook->do_action(Array(1))/home/site/public_html/wp-includes/plugin.php:470
5. do_action('init')/home/site/public_html/wp-settings.php:578
6. require_once('/home/site/publi...')/home/site/public_html/wp-config.php:88
7. require_once('/home/site/publi...')/home/site/public_html/wp-load.php:50
8. require_once('/home/site/publi...')/home/site/public_html/wp-blog-header.php:13
9. require('/home/site/publi...')/home/site/public_html/index.php:17
Context
URL /wp-json/ToolsetBlocks/Rest/API/v1/MediaObject?_locale=user

Notice: require_once(): read of 823 bytes failed with errno=12 Cannot allocate memory in /home/site/public_html/wp-content/plugins/types/vendor/toolset/toolset-common/bootstrap.php on line 389
Stack Trace
1. require_once()/home/site/public_html/wp-content/plugins/types/vendor/toolset/toolset-common/bootstrap.php:389
2. Toolset_Common_Bootstrap->register_inc()/home/site/public_html/wp-content/plugins/types/vendor/toolset/toolset-common/bootstrap.php:94
3. Toolset_Common_Bootstrap->__construct()/home/site/public_html/wp-content/plugins/types/vendor/toolset/toolset-common/bootstrap.php:126
4. Toolset_Common_Bootstrap::get_instance()/home/site/public_html/wp-content/plugins/types/application/controllers/main.php:171
5. Types_Main->after_setup_theme('')/home/site/public_html/wp-includes/class-wp-hook.php:303
6. WP_Hook->apply_filters(null, Array(1))/home/site/public_html/wp-includes/class-wp-hook.php:327
7. WP_Hook->do_action(Array(1))/home/site/public_html/wp-includes/plugin.php:470
8. do_action('after_setup_theme')/home/site/public_html/wp-settings.php:556
9. require_once('/home/site/publi...')/home/site/public_html/wp-config.php:88
10. require_once('/home/site/publi...')/home/site/public_html/wp-load.php:50
11. require_once('/home/site/publi...')/home/site/public_html/wp-blog-header.php:13
12. require('/home/site/publi...')/home/site/public_html/index.php:17
Context
URL /wp-json/ToolsetBlocks/Rest/API/v1/ShortcodeRender?_locale=user

Fatal error: require_once(): Failed opening required '/home/site/public_html/wp-content/plugins/types/vendor/toolset/toolset-common/inc/public_api/loader.php' (include_path='/home/site/public_html/wp-content/plugins/backwpup/vendor/pear/archive_tar:/home/site/public_html/wp-content/plugins/backwpup/vendor/pear/console_getopt:/home/site/public_html/wp-content/plugins/backwpup/vendor/pear/pear-core-minimal/src:/home/site/public_html/wp-content/plugins/backwpup/vendor/pear/pear_exception:.:/opt/alt/php74/usr/share/pear') in /home/site/public_html/wp-content/plugins/types/vendor/toolset/toolset-common/bootstrap.php on line 389
Context
URL /wp-json/wp/v2/blocks?context=edit&per_page=100&_locale=user

***************************************************************************************************************

I noticed another symptom that may or may not be related to whatever is going on. When I edit a Toolset Image block, now the dropdown for choosing image size under "Image Settings" does not load/appear.
I did a test to insert a dynamic image in a new blank post, and I get the error below (and again no option to edit the image size). If I insert a non-Dynamic image, the "Image Size" option for the block takes a little while to appear, but it does show up eventually.

Also, my Redirection plugin logs 404s whenever I load a post with a dynamic image (source URL /wp-admin/[tb-dynamic%20provider='custom_post_type|rpg-products|453'%20post='current'%20source='medi).

And I see the following notice on the post itself: "Something went wrong while fetching the dynamic content from the selected source, with message: "<p>There has been a critical error on this website.</p><p>Learn more about troubleshooting WordPress.</p>"."

If you think these are unrelated issues, let me know if I should start a separate ticket for the Dynamic Sources image problem!

Notice: Trying to get property 'post_type' of non-object in /home/site/public_html/wp-content/themes/genesis/lib/classes/class-genesis-script-loader.php on line 376
Stack Trace
1. Genesis_Script_Loader->visible_genesis_sidebar_panels()/home/site/public_html/wp-content/themes/genesis/lib/classes/class-genesis-script-loader.php:94
2. Genesis_Script_Loader->enqueue_block_editor_scripts('')/home/site/public_html/wp-includes/class-wp-hook.php:303
3. WP_Hook->apply_filters(null, Array(1))/home/site/public_html/wp-includes/class-wp-hook.php:327
4. WP_Hook->do_action(Array(1))/home/site/public_html/wp-includes/plugin.php:470
5. do_action('enqueue_block_editor_a...')/home/site/public_html/wp-content/plugins/wp-views/vendor/toolset/dynamic-sources/server/Rest/GetSource.php:75
6. Toolset\DynamicSources\Rest\GetSource->get_source(WP_REST_Request)/home/site/public_html/wp-includes/rest-api/class-wp-rest-server.php:1140
7. WP_REST_Server->respond_to_request(WP_REST_Request, '/toolset-dynamic-sourc...', Array(7), null)/home/site/public_html/wp-includes/rest-api/class-wp-rest-server.php:987
8. WP_REST_Server->dispatch(WP_REST_Request)/home/site/public_html/wp-includes/rest-api/class-wp-rest-server.php:414
9. WP_REST_Server->serve_request('/toolset-dynamic-sourc...')/home/site/public_html/wp-includes/rest-api.php:370
10. rest_api_loaded(WP)/home/site/public_html/wp-includes/class-wp-hook.php:303
11. WP_Hook->apply_filters('', Array(1))/home/site/public_html/wp-includes/class-wp-hook.php:327
12. WP_Hook->do_action(Array(1))/home/site/public_html/wp-includes/plugin.php:518
13. do_action_ref_array('parse_request', Array(1))/home/site/public_html/wp-includes/class-wp.php:388
14. WP->parse_request('')/home/site/public_html/wp-includes/class-wp.php:750
15. WP->main('')/home/site/public_html/wp-includes/functions.php:1291
16. wp()/home/site/site/wp-blog-header.php:16
17. require('/home/site/publi...')/home/site/public_html/index.php:17
Context
URL /wp-json/toolset-dynamic-sources/v1/get-source?post_type=rpg-products&post_id=453&_locale=user

***************************************************************************************************************
So, I guess clearing the cache for all Views seems to have resolved the error from my original post, but there still clearly seems to be something wrong!

I'd be glad to hear any other thoughts you may have on what I can try to troubleshoot this further.

Again today my site has maxed out its memory resource limit on the host after just a few attempts to edit some posts while testing, so the host limitation may be causing some of these errors, but something is causing the spikes in memory usage to get it limited in the first place!

Hope you can help! I'm happy to provide access to or a copy of the site.

Thanks!
Sarah

#2193463

Hello again!
I spent the rest of the day troubleshooting and ended up rebuilding some of my views and templates on local, re-imported the posts and postmeta tables from the local to live database, and used the Better Search Replace plugin to update the URLs. After some initial errors in the log, I'm no longer getting all those errors when editing, hooray! So, perhaps the database or some of the Views got corrupted during migration.

Now, I only seem to be getting errors when I edit one of my more complicated content templates.
Would it be best to create a new support thread since this more focused issue with the content template may not be related to what was going on before? At the very least, I'm not getting the same error I reported in the ticket title! I plan to give it a couple of days for more testing, to see if I can consistently replicate the errors and can also try recreating the content template.

Thanks for sticking with this so far!
-Sarah 🙂

#2193735

Hello Sarah, and thank you for your feedback.

We try to handle each request/issue on a separate ticket, to bring you a better service and also helps other users to find all the information here exposed. However, I don't feel like we helped you fix this issue, so it is fine with me if you want assistance with the content template issue here too. If you think that you will take some time before getting back here, then I'll suggest closing this ticket and you can open a new one when you are ready.

All the best,
Jamal

#2194221

Thanks, Jamal! I'm going to spend some time doing further testing and will create a new ticket when I have a firmer idea of exactly what is happening. For now, at least my site is not constantly erroring, so the issue is not quite as pressing as before!