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:

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

Anybody created an issue. See original summary.

anybody’s picture

Issue summary: View changes
geek-merlin’s picture

Good 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.

anybody’s picture

Thanks @geek-merlin! Nice to see things moving on here :)

1) Should instance settings like the label be editable?
2) Should an instance setting be deletable?

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

geek-merlin’s picture

You:
> 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.

anybody’s picture

Thanks @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.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.