Problem/Motivation
TL;DR:
locked: true in field.storage is a good thing, but needs to be a lot more granular. Specifically, it should not disallow editing the field instance defaults. Field storage lock should only lock storage related settings and prevent deleting the field storage. Field instance should have their own protection.
Of course there are cases, where both is needed in combination, but we had several cases, where we needed this to be more granular. Especially to be able to still change field instance default settings! (mostly for paragraphs, where fields were reused several times).
Steps to reproduce
Set locked: true on a field storage
Try to adjust the field instance default settings. This is not possible in UI, while it has nothing to do with the field storage, but is field instance configuration!
Proposed resolution
There are several possible solutions:
a) Allow editing the field instance related settings (from field.field.X....yml) if the field.storage is locked and only disallow changing the storage settings
b) Move the field default settings over from the field settings into the "Manage form settings" to allow per-form-display defaults
PLUS:
- Optionally implement
locked: truefor field instance configurations - or even more flexible split locked into
editableanddeletablefor storage and instance, as suggested here: #1297278: Replace field.locked by field.editable, field.deleteable, fieldinstance.editable, fieldinstance.deleteable
Comments
Comment #2
anybodyComment #3
anybodyComment #4
geek-merlinGood catch! Locking a field is about assuring its existance for code that depends on it.
It's not about assuring the value of a label.
But currently it MAY BE about assuring that a concrete bundle instance exists.
So i see two questions:
- 1) Should instance settings like the label be editable?
- 2) Should an instance setting be deletable?
So yes, the distinction of the related issue makes sense, so +1 for making this a dup.
Comment #5
anybodyThanks @geek-merlin! Nice to see things moving on here :)
Both YES, if the instance itself isn't also locked itself (eventually split into "deletable" and "editable" instead of "locked" in the future. What do you think about that split?
Eventually reply in #1297278: Replace field.locked by field.editable, field.deleteable, fieldinstance.editable, fieldinstance.deleteable
Comment #6
geek-merlinYou:
> What do you think about that split?
Me:
> So yes, the distinction of the related issue makes sense, so +1 for making this a dup.
This meant: The 2 questions are independent. Let's close this and work on in the other issue.
Comment #7
anybodyThanks @geek-merlin for the clarification! I'm fine with that, but when closing this, please ensure the key points are present in the other issues or transferred over there.
Also, we should ensure that #2274433: Do not allow to alter Locked field via UI sticks to the plan instead of clashing with it.