You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This request isn't a duplicate of an existing issue
I've read the docs and followed them (if applicable)
This is not a personal support request that should be posted on the Roots Discourse community
Description
Some PHP warnings may be emitted by current WP CLI stable release (2.4.0) (that should be fixed with nightly (2.5.0)) when installing new languages. These warnings wouldn't prevent WP CLI from installing these languages, but Sage 10 error handler turns these warnings into fatal errors that break the WP CLI command at that point.
PHP warning (not treated as fatal error, WP CLI execution can proceed):
PHP Warning: Declaration of WP_CLI\LanguagePackUpgrader::download_package($package, $check_signatures = false) should be compatible with WP_Upgrader::download_package($package, $check_signatures = false, $hook_extra = Array) in phar:///usr/bin/wp/vendor/wp-cli/language-command/src/WP_CLI/LanguagePackUpgrader.php on line 51
Warning: Declaration of WP_CLI\LanguagePackUpgrader::download_package($package, $check_signatures = false) should be compatible with WP_Upgrader::download_package($package, $check_signatures = false, $hook_extra = Array) in phar:///usr/bin/wp/vendor/wp-cli/language-command/src/WP_CLI/LanguagePackUpgrader.php on line 51
PHP warning turned into a PHP fatal error (Sage 10 theme error handler):
In LanguagePackUpgrader.php line 51:
Declaration of WP_CLI\LanguagePackUpgrader::download_package($package, $check_signatures = false) should be compatible with WP_U
pgrader::download_package($package, $check_signatures = false, $hook_extra = Array)
Steps to reproduce
Ensure WP CLI stable release 2.4.0 is installed on the server (a workstation/client WP CLI would just passthrough the commands).
Ensure the site uses a Sage 10-based theme.
Invoke WP CLI (server-side version!) to install a WordPress core language. Notice that a fatal error is logged, WP CLI execution aborted and the core language wasn't installed.
Also note that updating WP CLI to nightly release (2.5.0) is not sufficient as other PHP notices/warnings are emitted (e.g. In FileCache.php line 325: Trying to access array offset on value of type null), which will all break WP CLI execution.
Expected behavior:
PHP warnings and notices should not be escalated to PHP fatal errors, WP CLI should be able to finish execution.
Actual behavior:
PHP warnings and notices are escalated to PHP fatal errors, WP CLI is not able to finish execution.
Reproduces how often:
As long as the Sage 10 theme is used by the site or WP CLI less or equal the stable release (2.4.0) is used.
Also note that updating WP CLI to nightly release (2.5.0) is not sufficient as other PHP notices/warnings are emitted (e.g. In FileCache.php line 325: Trying to access array offset on value of type null), which will all break WP CLI execution.
This was fixed via wp-cli/wp-cli#5520 and will be included in the next nightly.
Description
Some PHP warnings may be emitted by current WP CLI stable release (
2.4.0
) (that should be fixed with nightly (2.5.0
)) when installing new languages. These warnings wouldn't prevent WP CLI from installing these languages, but Sage 10 error handler turns these warnings into fatal errors that break the WP CLI command at that point.PHP warning (not treated as fatal error, WP CLI execution can proceed):
PHP warning turned into a PHP fatal error (Sage 10 theme error handler):
Steps to reproduce
2.4.0
is installed on the server (a workstation/client WP CLI would just passthrough the commands).Also note that updating WP CLI to nightly release (
2.5.0
) is not sufficient as other PHP notices/warnings are emitted (e.g.In FileCache.php line 325: Trying to access array offset on value of type null
), which will all break WP CLI execution.Expected behavior:
PHP warnings and notices should not be escalated to PHP fatal errors, WP CLI should be able to finish execution.
Actual behavior:
PHP warnings and notices are escalated to PHP fatal errors, WP CLI is not able to finish execution.
Reproduces how often:
As long as the Sage 10 theme is used by the site or WP CLI less or equal the stable release (
2.4.0
) is used.Versions
Related issues
Related discussions
https://discourse.roots.io/t/workaround-php-7-4-x-fix-cli-deprecation-warning/18566/3
(how to enforce a specific WP CLI version on a Trellis system in order to fix a deployment-blocking issue)
The text was updated successfully, but these errors were encountered: