In the event subscriber, to check if the configuration object is changed, the following code is used.

if ($saved_config->getOriginal() !== $saved_config->getRawData()) {
  // …
}

Config::getOriginal() applies the overrides by default, while Config::getRawData() doesn't apply overrides. This means that the values returned from getOriginal() and getRawData() could be different, even if the configuration object didn't change.

The call to getOriginal() should pass FALSE as argument, to avoid comparing data with overrides with data without overrides.

Comments

apaderno created an issue. See original summary.

avpaderno’s picture

Issue summary: View changes

  • apaderno authored 8fc453b on 2.0.x
    Issue #3252662 by apaderno: In the ConfigEvents::SAVE event, the...

  • apaderno authored b9ee3a9 on 8.x-1.x
    Issue #3252662 by apaderno: In the ConfigEvents::SAVE event, the...
avpaderno’s picture

Version: 2.0.x-dev » 8.x-1.x-dev
Status: Active » Fixed

Status: Fixed » Closed (fixed)

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