Problem/Motivation

We noticed this, when we uninstalled the captcha module and the captcha sensor remained.

Steps to reproduce

  1. Install the captcha module.
  2. `drush cget monitoring.sensor_config.captcha_failed_count` and confirm that monitoring.sensor_config.captcha_failed_count has the dependency on captcha
  3. Edit the captcha_failed_count sensor and save it.
  4. `drush cget monitoring.sensor_config.captcha_failed_count` again and there will be no captcha dependency

Proposed resolution

Discussed this with @Berdir: "it's ugly, but I fear the only option here is a loop over all modules, then load the isntall file, then check if the hook exists and invoke it"

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork monitoring-3460176

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Primsi created an issue. See original summary.

primsi’s picture

I added a test, but didn't run it locally (because of some issue with running phpunit tests). Let's see how it goes.

berdir’s picture

Status: Active » Needs work
primsi’s picture

Status: Needs work » Needs review

Thx for the review. Addressed both comments.

  • berdir committed d160d6a8 on 8.x-1.x authored by primsi
    Issue #3460176: Dependencies lost after sensor save for the...
berdir’s picture

Status: Needs review » Fixed

Merged.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.