Skip to content

Conversation

schlessera
Copy link
Member

There was a regression in the code that handles command namespaces that made it impossible to extend an existing command class.

This PR reverts the regression and adds a test scenario to ensure this type of extension will not be regressing again.

Fixes #5274

@schlessera schlessera requested a review from a team as a code owner September 16, 2021 15:49
@schlessera schlessera added this to the 2.5.1 milestone Sep 16, 2021
Copy link

@sun sun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a simple fix accompanied with tests, which are passing. 👍

Wondering whether we should restore the final condition testing for other possible values of existing commands that were removed in the previous commit that introduced the test for false in #5203?

wp-cli/php/class-wp-cli.php

Lines 536 to 539 in 7e12cae

} elseif ( false !== $existing_command ) {
// Command already registered, so abort to avoid double registration.
return false;
}

@schlessera
Copy link
Member Author

Wondering whether we should restore the final condition testing for other possible values of existing commands that were removed in the previous commit that introduced the test for false in #5203?

I think that would make it impossible again to override bundled commands, as the new command would just be skipped.

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.

Extending an existing command stopped working in 2.2.0
2 participants