Change record status: 
Project: 
Introduced in branch: 
10.2.x
Introduced in version: 
10.2.0
Description: 

#3382580: Add new `ImmutableProperties` constraint introduced a new validation constraint for config entities: ImmutableProperties. This constraint does what it sounds like: it ensures that certain properties of a config entity have not been changed.

The main case for this, so far, is that config entities' IDs should not, generally, be changeable. Config entities are referenced by other config (and by content entities), all over the place, implicitly and explicitly. Changing a config entities' IDs can cause weird things to happen or, in the worst case, break sites outright. So, by default, config entity IDs are now considered an immutable property, and you will get a validation error if you try to change the ID of an existing config entity.

If there's a need for a particular config entity type to have mutable IDs, that can be done by adding this to the config entity type's definition:

constraints = {
  "ImmutableProperties" = {}
}

Or, if you want to make a particular set of properties immutable, rather than just the ID, you can do this:

constraints = {
  "ImmutableProperties" = {"some_property", "another_property"}
}
Impacts: 
Module developers