Skip to main content
added 21 characters in body
Source Link
4uk4
  • 101.7k
  • 7
  • 173
  • 217

In a configuration form use $this->config() and not \Drupal::config().

The difference between both is that the configuration form uses immutable configuration.

When Drupal 8 was in beta, the immutable configuration was introduced to avoid bleeding of overridden values into configuration when saved to the database. See the change record:

Configuration objects by default are immutable

This is the code executed by $this->config() of a configuration form, in a static version:

\Drupal::configFactory()->getEditable('system.site')->set('name', 'My fantastic site')->save();

For Drupal 8.7 it is discussed to display a warning for overridden values:

This form contains values that have been overridden. Changes to these values can still be saved, but the overridden values will take precedence. Overrides are as follows ...

See the issue:

There is no indication on configuration forms if there are overridden values

In a configuration form use $this->config() and not \Drupal::config().

The difference between both is that the configuration form uses immutable configuration.

When Drupal 8 was in beta, the immutable configuration was introduced to avoid bleeding of overridden values into configuration when saved to the database. See the change record:

Configuration objects by default are immutable

This is the code executed by $this->config() of a configuration form:

\Drupal::configFactory()->getEditable('system.site')->set('name', 'My fantastic site')->save();

For Drupal 8.7 it is discussed to display a warning for overridden values:

This form contains values that have been overridden. Changes to these values can still be saved, but the overridden values will take precedence. Overrides are as follows ...

See the issue:

There is no indication on configuration forms if there are overridden values

In a configuration form use $this->config() and not \Drupal::config().

The difference between both is that the configuration form uses immutable configuration.

When Drupal 8 was in beta, the immutable configuration was introduced to avoid bleeding of overridden values into configuration when saved to the database. See the change record:

Configuration objects by default are immutable

This is the code executed by $this->config() of a configuration form, in a static version:

\Drupal::configFactory()->getEditable('system.site')->set('name', 'My fantastic site')->save();

For Drupal 8.7 it is discussed to display a warning for overridden values:

This form contains values that have been overridden. Changes to these values can still be saved, but the overridden values will take precedence. Overrides are as follows ...

See the issue:

There is no indication on configuration forms if there are overridden values

deleted 16 characters in body
Source Link
4uk4
  • 101.7k
  • 7
  • 173
  • 217

In a configuration form you should use $this->config() and not \Drupal::config().

The difference between both is, that the configuration form uses immutable configuration. 

When Drupal 8 was in beta, thisthe immutable configuration was introduced to avoid bleeding of overridden values into configuration when you save itsaved to the database. See the change record:

Configuration objects by default are immutable

This is what the configuration form does in static code executed by using $this->config() of a configuration form:

\Drupal::configFactory()->getEditable('system.site')->set('name', 'My fantastic site')->save();

For Drupal 8.57 it is discussed to display a warning in the configuration form, that there arefor overridden values:

This form contains values that have been overridden. Changes to these values can still be saved, but the overridden values will take precedence. Overrides are as follows ...

See the issue:

There is no indication on configuration forms if there are overridden values

In a configuration form you should use $this->config() and not \Drupal::config().

The difference is, that the configuration form uses immutable configuration. When Drupal 8 was in beta, this was introduced to avoid bleeding of overridden values into configuration when you save it. See the change record:

Configuration objects by default are immutable

This is what the configuration form does in static code by using $this->config():

\Drupal::configFactory()->getEditable('system.site')->set('name', 'My fantastic site')->save();

For Drupal 8.5 it is discussed to display a warning in the configuration form, that there are overridden values:

This form contains values that have been overridden. Changes to these values can still be saved, but the overridden values will take precedence. Overrides are as follows ...

See the issue:

There is no indication on configuration forms if there are overridden values

In a configuration form use $this->config() and not \Drupal::config().

The difference between both is that the configuration form uses immutable configuration. 

When Drupal 8 was in beta, the immutable configuration was introduced to avoid bleeding of overridden values into configuration when saved to the database. See the change record:

Configuration objects by default are immutable

This is the code executed by $this->config() of a configuration form:

\Drupal::configFactory()->getEditable('system.site')->set('name', 'My fantastic site')->save();

For Drupal 8.7 it is discussed to display a warning for overridden values:

This form contains values that have been overridden. Changes to these values can still be saved, but the overridden values will take precedence. Overrides are as follows ...

See the issue:

There is no indication on configuration forms if there are overridden values

added 97 characters in body
Source Link
4uk4
  • 101.7k
  • 7
  • 173
  • 217

In a configuration form you should use $this->config() and not \Drupal::config().

The difference is, that the configuration form uses immutable configuration. When Drupal 8 was in beta, this was introduced to avoid bleeding of overridden values into configuration when you save it, see. See the change record  :

Configuration objects by default are immutable.

This is what the configuration form does in static code by using $this->config():

\Drupal::configFactory()->getEditable('system.site')->set('name', 'My fantastic site')->save();

For Drupal 8.5 it is discussed to display a warning in the configuration form, that there are overridden values:

This form contains values that have been overridden. Changes to these values can still be saved, but the overridden values will take precedence. Overrides are as follows ...

See the issue  :

https://www.drupal.org/node/2408549There is no indication on configuration forms if there are overridden values

In a configuration form you should use $this->config() and not \Drupal::config().

The difference is, that the configuration form uses immutable configuration. When Drupal 8 was in beta this was introduced to avoid bleeding of overridden values into configuration when you save it, see the change record  Configuration objects by default are immutable.

This is what the configuration form does in static code by using $this->config():

\Drupal::configFactory()->getEditable('system.site')->set('name', 'My fantastic site')->save();

For Drupal 8.5 it is discussed to display a warning in the configuration form, that there are overridden values:

This form contains values that have been overridden. Changes to these values can still be saved, but the overridden values will take precedence. Overrides are as follows ...

See the issue  https://www.drupal.org/node/2408549

In a configuration form you should use $this->config() and not \Drupal::config().

The difference is, that the configuration form uses immutable configuration. When Drupal 8 was in beta, this was introduced to avoid bleeding of overridden values into configuration when you save it. See the change record:

Configuration objects by default are immutable

This is what the configuration form does in static code by using $this->config():

\Drupal::configFactory()->getEditable('system.site')->set('name', 'My fantastic site')->save();

For Drupal 8.5 it is discussed to display a warning in the configuration form, that there are overridden values:

This form contains values that have been overridden. Changes to these values can still be saved, but the overridden values will take precedence. Overrides are as follows ...

See the issue:

There is no indication on configuration forms if there are overridden values

added 77 characters in body
Source Link
4uk4
  • 101.7k
  • 7
  • 173
  • 217
Loading
added 89 characters in body
Source Link
4uk4
  • 101.7k
  • 7
  • 173
  • 217
Loading
Source Link
4uk4
  • 101.7k
  • 7
  • 173
  • 217
Loading