Problem/Motivation

We can use multiple ways to disable the purger's configuration for a given context/environment (Config Split module, settings.php files, etc.). When the purger's status is set to false, we expect it to stop sending requests to Bunny's API.

Steps to reproduce

  1. Configure a purger
  2. Export the config to files
  3. Manually edit the config file to set status to false
  4. Import the config from the files

Expected result: the cache stops being invalidated
Current result: the cache is still invalidated

Proposed resolution

Add conditions to check if the configuration is enabled before doing anything.

CommentFileSizeAuthor
#3 3592375-2.patch1.18 KBduaelfr

Issue fork bunny_cdn-3592375

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

duaelfr created an issue. See original summary.

duaelfr’s picture

Assigned: duaelfr » Unassigned
Status: Active » Needs review
StatusFileSize
new1.18 KB

Patch attached for composer.

dieterholvoet’s picture

Status: Needs review » Needs work

The phpdoc of Drupal\Core\Config\Entity\ConfigEntityInterface::status says the following:

Status implementations for configuration entities should follow these
general rules:
- Status does not affect the loading of entities. I.e. Disabling
configuration entities should only have UI/access implications.
- It should only take effect when a 'status' key is explicitly declared
in the entity_keys info of a configuration entity's annotation data.
- Each entity implementation (entity/controller) is responsible for
checking and managing the status.

So I guess we need to change entity_keys as well.

duaelfr’s picture

Status: Needs work » Needs review

Nice catch!
Thanks for the quick review :)

dieterholvoet’s picture

Status: Needs review » Fixed

Thanks for the contribution!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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