`activate/deactivate` command does not pass `$network_wide` as `bool`
swissspidy opened this issue · 1 comments
Bug Report
- Yes, I reviewed the contribution guidelines.
- Yes, more specifically, I reviewed the guidelines on how to write clear bug reports.
Describe the current, buggy behavior
When calling wp plugin activate
or wp plguin deactivate
without explicitly pass --network
, $network_wide
will be null
instead of false
.
This causes errors if a plugin uses parameter types like this:
function myplugin_activate( bool $network_wide = false ): void {
// ...
}
register_activation_hook( __FILE__, 'myplugin_activate' );
extension-command/src/Plugin_Command.php
Line 311 in 266d53d
Describe how other contributors can replicate this bug
Describe what you would expect as the correct outcome
No errors
Let us know what environment you are running this on
(Paste the output of "wp cli info" into this box)
Provide a possible solution
$network_wide
should default to false
so it's always a bool
Provide additional context/Screenshots
Add any other context about the problem here.
If applicable, add screenshots to help explain (you can just drag&drop images into the Github issue).
I'll look into this issue during the WCEU Contributor day 2023.