Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Undefined array key warning / Require wp-cli 2.11 #525

Merged
merged 1 commit into from
Jul 3, 2024

Conversation

BrianHenryIE
Copy link
Member

PHP Warning:  Undefined array key "hook" in /.../wp-cli/handbook/bin/command.php on line 438

The $cmd['hook'] value

$hook_name = $cmd['hook'];

which stems from

'cli cmd-dump',

which uses CLI_Command::command_to_array()

was added in the (yet to be released) v2.11 (vs v2.10) – wp-cli/wp-cli@6d78633.

This PR adds "wp-cli/wp-cli": "^2.11" to composer.json so the correct minimum version is used.

@BrianHenryIE BrianHenryIE requested a review from a team as a code owner July 3, 2024 01:47
@ernilambar
Copy link
Member

Did you follow these steps?

wp cli update --nightly
bin/install_packages.sh
WP_CLI_PACKAGES_DIR=bin/packages WP_CLI_CONFIG_PATH=/dev/null wp handbook gen-all

Generally handbook commands docs are generated with nightly version.

@swissspidy
Copy link
Member

Makes sense to have that explicitly reflected in the composer dependencies 👍

@ernilambar ernilambar added this to the 2.11.0 milestone Jul 3, 2024
@ernilambar ernilambar merged commit 4b43b03 into wp-cli:main Jul 3, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants