- 🇮🇳India mohit_aghera Rajkot
Hi @alan d
Thanks for raising the issue.
This seems to have carried over from Drupal 7.
Even on Drupal 11.x ImageItem plugin doesn't have the'#disabled' => $has_data
(core/modules/image/src/Plugin/Field/FieldType/ImageItem.php line 200 or so)File field settings form when field has data:
Image field settings form when field has data:
I believe this might have missed while porting to D8+.
Decide whether we should keep or not:
- I believe we should keep the#disabled
attribute if image field has data.If we consider the following scenario:
- In initial phase we mark image field as public file field.
- Upload a few files.
- Later change this field as private
- Expectation to editors will be they all the existing files are private however they are not.
So essentially if field has data then this option should be disabled.I am tagging sub system maintainer review.
- 🇦🇺Australia mstrelan
I don't necessarily agree with #31. Most of the time editors are not aware of the difference of public / private. Therefore it should be up to site builders to determine how to communicate this.
We have a use case for converting a file field on a media bundle to use private, to allow for an editorial workflow. The expectation is that files attached to draft and archived media entities should not be accessible to anonymous users. We already have existing files in public, and we can either choose to move them all to private, or leave them as they are and only use private file system for new files. We could even implement a presave hook that moves files to the private file system when the media entity is archived.
- 🇦🇺Australia mstrelan
It seems the $has_data lock was added to the uri_scheme in comment #17 of #367013-17: Field update (field_update_field) → with no discussion as to why. Here's the commit db09a617. The intent of that issue was to prevent changes to fields that would introduce schema changes, but there is no schema change here.