The config system hardcodes a number of required "config system housekeeping" properties in ConfigEntities and their YAML representation - id, uuid, language, dependencies, status, maybe soon third_party_settings...
But since those "system" properties live in the same namespace than the set of "domain" properties of each ConfigEntity type, there's always a risk of name clashes. As long as D8 is in developpement, the config system simply claims some property names, and contrib ConfigEntities need to adapt by not using a domain property with the same name.
Once 8.0 is out, though, it will be very hard to add/rename "system" properties in ConfigEntityBase if the need arises in 8.1 or even in 9, because there is no way to be sure that this new property will not clash with an existing "domain" property in some config entity type somewhere. De facto, we're locked.
The fact that we are still adjusting some of those "system" properties at this point in the cycle (rename some, add others...) - because, well, CMI is complex and takes a long time to be done right - is IMO a clear sign that we can't really say for sure we won't need to adjust more stuff later on.
I feel stupid for not spotting that earlier :-/, since this is exactly the reason why Field API separates "Field API system" properties ($field->label, $field->required) and "field-type specific" settings ($field->settings['foo']) - so we can add new top level "system" properties at any point without fearing that some contrib / custom field type somewhere might have a "domain" setting with the same name.
Ideally, ConfigEntities should have separate spaces for "system" and "domain" properties - something like "header" & "payload", in a way...
Comments
Comment #1
yched commentedLeaving the priority/criticalness up for discussion :-)
In a way, this could be seen as just an instance of the much more general "yeah, adding new properties in any class that's intended to be a base class, can be problematic for BC, because you don't know what properties exist in child classes". Which would probably make this issue a "that's life, won't fix".
The specific thing about ConfigEntityBase is that it's the ubiquitous container for 95% of our yaml config records...
Comment #2
yched commentedComment #3
alexpottDiscussed this with @catch in IRC when I first read the comment in the other issue.
I think we could document that any root properties starting with _ are reserved for API additions in the 8.x cycle. When we add one of these we should automatically deprecate for 9.x and create an issue to remove the _ against 9.x
So I think we should do a documented version of
Comment #4
yched commentedNot nice, but yeah, that's probably our best option for the D8 cycle at this point.
Hopefully in D9 we can move to a clustered approach (putting system properties in a separate top-level entries or something).
So, actianable steps here would be - what ? Add some doc about "don't define properties starting with _" in ConfigEntityBase ?
Comment #5
fabianx commentedI still like my proposal to use actual namespaces, like:
drupal.core.uuid instead as I cannot see the difference to class namespaces ...
drupal.yourmodule.yourproperty: 42
etc.
Comment #6
xjmDiscussed with @alexpott this morning. This is unfortunately far too disruptive for 8.0.x at this point for an edgecase problem. We can document the workaround with the underscore explained in #3. There's also no way to sanely fix this with BC, so postponing to 9.x.
Tagging for a followup for the docs.
Comment #7
catchI think we could add an ugly bc layer for this in a late minor release of 8.x - that would allow for forward compatibility of default config YAML between versions if it was using the new property names. Moving back to 8.1.x for now.
Comment #23
smustgrave commentedThank you for creating this issue to improve Drupal.
We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!
Comment #24
smustgrave commentedWanted to bump this 1 more time before closing.
Comment #25
geek-merlinYes, i still see this as a valid issue with no solution.