Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The drush command is broken.
$ drush monitoring-sensor-config
PHP Fatal error: Call to a member function getLabel() on a non-object in /usr/local/var/www/d8.dev/www/modules/monitoring/monitoring.drush.inc on line 147
And more fun to enjoy...
$ drush monitoring-purge-settings node_new_all
exception 'Drupal\Core\Config\ImmutableConfigException' with message 'Can not set values on immutable configuration monitoring.settings:node_new_all. Use [error]
\Drupal\Core\Config\ConfigFactoryInterface::getEditable() to retrieve a mutable configuration object' in
/usr/local/var/www/d8.dev/www/core/lib/Drupal/Core/Config/ImmutableConfig.php:34
$ drush monitoring-disable node_new_all
The sensor All new nodes is currently disabled.
(Although the sensor was enabled and still is.)
Proposed resolution
Fix it.
And check all other drush commands.
Possibly more are broken?
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#3 | drush_broken-2530372-3.patch | 3.65 KB | mbovan |
#3 | drush_broken-2530372-3-interdiff.txt | 3.3 KB | mbovan |
#1 | drush_broken-2530372-1.patch | 3.05 KB | mbovan |
Comments
Comment #1
mbovan CreditAttribution: mbovan at MD Systems GmbH commentedFixed monitoring-sensor-config, monitoring-purge-settings and monitoring-disable commands.
Changed a message for already disabled sensors to match "enabled" sensor message.
Added check for non existing sensors in monitoring-purge-settings. Otherwise, we can get a message that settings are purged for non-existent sensor.
Other drush commands work as expected.
Comment #2
Berdir$sensors_config is a bit weird.
What about $sensor_config_list and $sensor_config as the variable names?
Was that broken at some point during the port or is it also like this in the 7.x-1.x branch?
This makes no sense anymore. This configuration doesn't exist anymore, sensors are config entities. Let's just remove this command.
Comment #3
mbovan CreditAttribution: mbovan at MD Systems GmbH commented1. Renamed.
2. It seems that is the same error in 7.x-1.x. I'll open a 7.x-1.x issue?
3. Removed.
Comment #4
Berdir2. Yes, separate issue makes sense, since this also does a lot of other things, so it doesn't really make sense to backport this issue.
Comment #5
mbovan CreditAttribution: mbovan at MD Systems GmbH commentedOk, here is the 7.x-1.x issue: #2532040: Fix disabling sensors using drush.
Comment #6
BerdirThanks, committed.
Comment #8
Berdir