extension-command icon indicating copy to clipboard operation
extension-command copied to clipboard

Notice: Trying to access array offset on value of type null in Theme_Command.php on lines 472-473

Open slaFFik opened this issue 4 years ago • 5 comments

Bug Report

Describe the current, buggy behavior

When running this cli command: wp theme update --all I get a ton of these notices:

Notice: Trying to access array offset on value of type null in phar://C:/OpenServer/modules/php/PHP_7.4/wp-cli.phar/vendor/wp-cli/extension-command/src/Theme_Command.php on line 472
Notice: Trying to access array offset on value of type null in phar://C:/OpenServer/modules/php/PHP_7.4/wp-cli.phar/vendor/wp-cli/extension-command/src/Theme_Command.php on line 473

There is a similar notice for wp plugin update --all, see https://github.com/wp-cli/wp-cli/issues/5422, and it was fixed (not released though).

I'm on WP 5.6, WP CLI 2.4.0, PHP 7.4.4.

slaFFik avatar Dec 13 '20 20:12 slaFFik

I had the same issue with WP 5.6, WP-CLI 2.4.0 and PHP 7.4.13

After updating to the latest nightly (with wp cli update --nightly) the warning is gone (horray!)

pdobrescu avatar Dec 19 '20 12:12 pdobrescu

Nightly version breaks my building steps, so I can't use it.

slaFFik avatar Dec 21 '20 12:12 slaFFik

@slaFFik Please describe what's broken.

wojsmol avatar Dec 21 '20 12:12 wojsmol

Yes, indeed, would also love to know what is breaking in current nightly.

schlessera avatar Dec 22 '20 14:12 schlessera

Its been awhile since this was reported, but I'm still seeing this issue as well.

I'm running WP 5.7, WP-CLI 2.4.0 and PHP 7.4.15. I haven't tried the nightly release of WP-CLI yet.

I should note that the warnings and notices seem to only be output when define( 'WP_DEBUG', true ); is set.

$ wp core update && wp plugin update --all && wp theme update --all

Updating to version 5.7 (en_US)...
Warning: Declaration of WP_CLI\Core\CoreUpgrader::download_package($package, $check_signatures = true) should be compatible with WP_Upgrader::download_package($package, $check_signatures = false, $hook_extra = Array) in phar:///usr/local/bin/wp/vendor/wp-cli/core-command/src/WP_CLI/Core/CoreUpgrader.php on line 30
Downloading update from https://downloads.wordpress.org/release/wordpress-5.7-no-content.zip...
Unpacking the update...
Cleaning up files...
No files found that need cleaning up.
Success: WordPress updated successfully.
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 662
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 663
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 662
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 663
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 662
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 663
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 662
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 663
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 662
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 663
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 662
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 663
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 662
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 663
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 662
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 663
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 662
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 663
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 662
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 663
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 662
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 663
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 662
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 663
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 662
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 663
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 662
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 663
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 662
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 663
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 662
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 663
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 662
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 663
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 662
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 663
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 662
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 663
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 662
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 663
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 662
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 663
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 662
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 663
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 662
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 663
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 662
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 663
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 662
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 663
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 662
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 663
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 662
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 663
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 662
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 663
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 662
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 663
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 662
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 663
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 662
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 663
Enabling Maintenance mode...
Downloading update from https://downloads.wordpress.org/plugin/content-views-query-and-display-post-page.2.4.0.1.zip...
The authenticity of content-views-query-and-display-post-page.2.4.0.1.zip could not be verified as no signature was found.
Unpacking the update...
Installing the latest version...
Removing the old version of the plugin...
Plugin updated successfully.
Downloading update from https://tablepress.org/update/extension/tablepress-responsive-tables.zip...
Unpacking the update...
Installing the latest version...
Removing the old version of the plugin...
Plugin updated successfully.
Disabling Maintenance mode...
Success: Updated 2 of 2 plugins.
+-------------------------------------------+-------------+-------------+---------+
| name                                      | old_version | new_version | status  |
+-------------------------------------------+-------------+-------------+---------+
| content-views-query-and-display-post-page | 2.4.0       | 2.4.0.1     | Updated |
| tablepress-responsive-tables              | 1.7         | 1.8         | Updated |
+-------------------------------------------+-------------+-------------+---------+
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Theme_Command.php on line 472
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Theme_Command.php on line 473
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Theme_Command.php on line 472
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Theme_Command.php on line 473
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Theme_Command.php on line 472
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Theme_Command.php on line 473
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Theme_Command.php on line 472
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Theme_Command.php on line 473
Downloading update from https://downloads.wordpress.org/theme/twentytwentyone.1.2.zip...
The authenticity of twentytwentyone.1.2.zip could not be verified as no signature was found.
Unpacking the update...
Installing the latest version...
Removing the old version of the theme...
Theme updated successfully.
Success: Updated 1 of 1 themes.
+-----------------+-------------+-------------+---------+
| name            | old_version | new_version | status  |
+-----------------+-------------+-------------+---------+
| twentytwentyone | 1.1         | 1.2         | Updated |
+-----------------+-------------+-------------+---------+

nlenkowski avatar Mar 11 '21 16:03 nlenkowski

I see the same problem in WP-CLI 2.7.1 (php8.0)

WP_DEBUG true/false irrelevant.

PHP Warning: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Theme_Command.php on line 472 Warning: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Theme_Command.php on line 472 PHP Warning: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Theme_Command.php on line 473 Warning: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Theme_Command.php on line 473 PHP Warning: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Theme_Command.php on line 472 Warning: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Theme_Command.php on line 472 PHP Warning: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Theme_Command.php on line 473 Warning: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Theme_Command.php on line 473

Any work around available after 2 years perhaps..? :)

Happy to add troubleshooting if needed. Multiple sites involved.

knofte avatar Feb 02 '23 20:02 knofte

Assuming this is fixed up now. Feel free to stop by the #cli channel on WordPress.org Slack if you'd like help debugging further.

danielbachhuber avatar Aug 29 '23 21:08 danielbachhuber