Skip Navigation

[Assigned] ‘Invalid argument supplied for foreach()’ after latest toolset updates

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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 4 replies, has 1 voice.

Last updated by UNC Digital Services 13 hours, 19 minutes ago.

Assisted by: Minesh.

Author
Posts
#2810547

These errors are occurring after installing the latest updates for all of the toolset packages.



 in OTGS_Installer_Repositories::get_repositories called at /code/web/wp-content/plugins/types/vendor/otgs/installer/includes/repository/class-otgs-installer-repositories.php (19)
 in OTGS_Installer_Repositories::__construct called at /code/web/wp-content/plugins/types/vendor/otgs/installer/includes/repository/class-otgs-installer-repositories-factory.php (8)
 in OTGS_Installer_Repositories_Factory::create called at /code/web/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-factory.php (321)
 in OTGS_Installer_Factory::get_repositories called at /code/web/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-factory.php (249)
 in OTGS_Installer_Factory::create_upgrade_response called at /code/web/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-factory.php (259)
 in OTGS_Installer_Factory::load_upgrade_response called at /code/web/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-loader.php (25)
 in OTGS_Installer_Loader::load_actions_after_installer_init called at /code/web/wp-includes/class-wp-hook.php (324)
 in WP_Hook::apply_filters called at /code/web/wp-includes/class-wp-hook.php (348)
 in WP_Hook::do_action called at /code/web/wp-includes/plugin.php (517)
 in do_action called at /code/web/wp-content/plugins/types/vendor/otgs/installer/includes/class-wp-installer.php (254)
 in WP_Installer::init called at /code/web/wp-includes/class-wp-hook.php (324)
 in WP_Hook::apply_filters called at /code/web/wp-includes/class-wp-hook.php (348)
 in WP_Hook::do_action called at /code/web/wp-includes/plugin.php (517)
 in do_action called at /code/web/wp-settings.php (704)
 in require_once called at /code/web/wp-config.php (285)
 in require_once called at /code/web/wp-load.php (50)
 in require_once called at /code/web/wp-cron.php (46)
#2810627

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Based on the debug information you shared, I can see that you are using Toolset Types (3.6.0-patch) version.

Can you please uipdate ALL Toolset plugins to it's latest released version. Please check the following blog post.
=> https://toolset.com/2025/04/toolset-1-6-19-openstreetmap-integration/

Also, for better performance, you may want to update the PHP version to PHP 8.1.x or 8.2.x.

#2810687

We are on PHP version 7.x .
Everything is updated to the latest. We had to patch that version (3.6) because of an error in the code that was shutting eveyrhting down and throwing errors to end users. Here's the change we had to make.
Your original code:

$settings            = $this->get_installer()->get_settings();
$this->plugin_finder = new OTGS_Installer_Plugin_Finder( $this->get_plugin_factory(), $settings['repositories'] );

The patched code:

$settings = $this->get_installer()->get_settings();
$repositories = isset($settings['repositories']) && is_array($settings['repositories']) ? $settings['repositories'] : [];
$this->plugin_finder = new OTGS_Installer_Plugin_Finder( $this->get_plugin_factory(), $repositories );
#2811100

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Just to confirm what file you were talking about and make the change.

It seems you are talking about the file: types\vendor\otgs\installer\includes\class-otgs-installer-factory.php line (234) - correct?

#2811397
Screenshot 2025-06-05 at 4.56.29 PM.png

yes - vendor/otgs/installer/includes/class-otgs-installer-factory.php - see screenshot