I opened a ticket ‘Invalid argument supplied for foreach()’ after latest toolset updates' which was closed but never resolved, can we please get this bug, it's affecting around a 100 sites.
We’re encountering a recurring issue with the Toolset Types plugin on our WordPress multisite network hosted on Pantheon.
The error appears during execution of wp-cron.php and when accessing /wp-admin/plugins.php on certain subsites. Here’s a representative error message:
Warning: Invalid argument supplied for foreach() in /wp-content/plugins/types/vendor/otgs/installer/includes/repository/class-otgs-installer-repositories.php on line 29
This seems to occur when OTGS_Installer_Repositories::get_repositories() is called and receives a null or otherwise invalid response, which is then passed to foreach() without validation.
About our environment:
We are hosted on Pantheon, which uses a read-only file system in runtime environments. This means:
• Plugin and theme updates via the WordPress admin are blocked.
• Files in wp-content/plugins/ cannot be written to at runtime.
• Update requests may fail or return incomplete responses when plugins attempt to perform update operations.
What we’ve tried:
• Defining OTGS_DISABLE_AUTO_UPDATES in both wp-config.php .
• Defining OTGS_INSTALLER_SITE_KEY_TOOLSET with a valid license key.
• Clearing all transients and flushing the object cache.
• Deactivating the plugin (which stops the fatal error on plugins.php).
Despite all of this, the plugin appears to continue executing update-related logic, and fails when the expected data structure is missing or malformed.
Our request:
1. Please add a check to ensure get_repositories() returns an array before it is passed to foreach().
2. Ensure the OTGS_DISABLE_AUTO_UPDATES constant disables all update-related logic early in execution.
3. Consider documenting or supporting better compatibility for users on read-only environments like Pantheon.
Please let us know if there is a more reliable way to disable Toolset’s update mechanism entirely in our environment.
Hello. Thank you for contacting the Toolset support.
I've raised your voice within our internal ticket and our Devs will try to provide hotfix version as soon as they can. I'll get in touch with you once I've any update on this.