wpcli diff returning invalid argument supplied for foreach
-
Using WP-CFM to distribute default settings to distributed sites. Changed the configuration file location via
add_filter('wpcfm_config_dir', <function>)
, and changed file type to yaml viaadd_filter('wpcfm_config_format', <function>)
. Attempting to use wpcli commands to diff. Bothwp config push <bundle>
andwp config pull <bundle>
work correctly. If I dowp config diff <bundle>
and the values in the db are identical to the values in the config file, then I get the expectedWarning: Both versions are identical
. However, if the configuration file is changed and I attempt to dowp config diff <bundle>
I receive the errorPHP Warning: Invalid argument supplied for foreach() in /app/web/wp-content/mu-plugins/wp-cfm/includes/class-wp-cli.php on line 92 PHP Warning: Invalid argument supplied for foreach() in /app/web/wp-content/mu-plugins/wp-cfm/includes/class-wp-cli.php on line 100
If I debug the contents of $compare at those lines, it contains a linefeed separated string of my configuration values, not an array of values as expected.
SAMPLE:
cache_control_attachment_max_age: \'10800\' cache_control_attachment_staleerror: \'10800\' cache_control_attachment_stalereval: \'10800\' cache_control_attachment_s_maxage: \'5400\'
Running Diff in the web gui returns the expected differences.
WordPress is version 5.2.1.
WP-CFM is version 1.5.1.
PHP is version 7.2.19Running WP-CFM as a must-use plugin.
Any ideas on why this is breaking?
- The topic ‘wpcli diff returning invalid argument supplied for foreach’ is closed to new replies.