Skip to content

Support multiple values on "plugin list --status=X" #194 - #199

Closed
xyulex wants to merge 4 commits into
wp-cli:masterfrom
xyulex:master
Closed

xyulex wants to merge 4 commits into
wp-cli:masterfrom
xyulex:master

Conversation

@xyulex

@xyulex xyulex commented Oct 23, 2019

Copy link
Copy Markdown

Added support for multiple values in plugin list --status (e.g. wp plugin list --status=active,inactive"

@xyulex
xyulex requested a review from a team as a code owner October 23, 2019 15:40
@xyulex

xyulex commented Oct 23, 2019

Copy link
Copy Markdown
Author

@schlessera Travis CI is returning some errors. I launched the behat in my computer and they return the same errors in the original repo. Am I missing something?

@xyulex

xyulex commented Oct 28, 2019

Copy link
Copy Markdown
Author

@schlessera Can I get some support on it?

@schlessera

Copy link
Copy Markdown
Member

@xyulex You're logic seems to be off.

First of all, you're replacing the initial logic, instead of adding to it. So while you're trying to add this status filtering, you're breaking the rest of the fields.

Also, after your explode(), you should do something like this for deciding when to remove:

if ( ! in_array( $assoc_args[ 'status' ], $statuses, true ) ) {
	unset( $all_items[ $key ];
}

Does that make sense?

@xyulex

xyulex commented Nov 14, 2019

Copy link
Copy Markdown
Author

@schlessera I already did that change in that commit: edcf08c

@schlessera

Copy link
Copy Markdown
Member

@xyulex No, this is not what I'm referring to. This is the total change so far in this PR:
Image 2019-11-14 at 3 15 20 PM

As you can see, the entire logic is only executed if it encounters the status field. For any other field, where it would previously unset() the ones that weren' matching, it does not do anything anymore.

You replaced the logic for handling all fields with the logic for handling the status field only.

@schlessera

Copy link
Copy Markdown
Member

Thanks for all the effort, @xyulex!

This was fixed via #234

@schlessera schlessera closed this Jul 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants