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
I am trying to add information to drush status following the example ExampleStatusFieldHook.
To Reproduce
Created a command file following the pattern in ExampleStatusFieldHook.
Expected behavior
$options['fields']->getDefault() returns a comma-separated lists of the fields that appear by default when drush status is run.
Actual behavior
$options['fields']->getDefault() returns the empty string. As a result, when I set the default to ,example-status, it gives the error that there is no field named by the empty string (referring to the empty string before the comma). If I set the default to just example-status, then just that field appears instead of that field being added to what is normally output.
Workaround
I could hard-code the list of fields in my command. This would mean that I would have to update my command if the list ever changes.
System Configuration
Q
A
Drush version?
12.5.2.0
Drupal version?
10.2.6
PHP version
8.2.9
OS?
Linux
Additional information
The above only happens if I make it site-wide command. It does not work if I put the command in the module. In this case, @hook command-event core:status never gets triggered, so I must add --fields=* or --field=example-status to see the new information.
The text was updated successfully, but these errors were encountered:
Describe the bug
I am trying to add information to
drush status
following the example ExampleStatusFieldHook.To Reproduce
Created a command file following the pattern in
ExampleStatusFieldHook
.Expected behavior
$options['fields']->getDefault()
returns a comma-separated lists of the fields that appear by default whendrush status
is run.Actual behavior
$options['fields']->getDefault()
returns the empty string. As a result, when I set the default to,example-status
, it gives the error that there is no field named by the empty string (referring to the empty string before the comma). If I set the default to justexample-status
, then just that field appears instead of that field being added to what is normally output.Workaround
I could hard-code the list of fields in my command. This would mean that I would have to update my command if the list ever changes.
System Configuration
Additional information
The above only happens if I make it site-wide command. It does not work if I put the command in the module. In this case,
@hook command-event core:status
never gets triggered, so I must add--fields=*
or--field=example-status
to see the new information.The text was updated successfully, but these errors were encountered: