Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I want to provide a locked Field API field (see field_create_field()) via a Feature module but it seems impossible to do so because field_features_export_render() explicitly unsets $field['field_config']['locked']. Why would this be unset? I don't see any harm in letting that be exported.
Comment | File | Size | Author |
---|---|---|---|
#1 | 1567506-export-locked-field.patch | 670 bytes | Dave Reid |
Comments
Comment #1
Dave ReidComment #2
hefox CreditAttribution: hefox commentedMy guess is the same reason that can't export a view as disabled (at least in d6 views); when it was being written, whoever wrote it thought that setting would not be wanted.
If it works, seems like a good change.
edit: For those reading along: locked prevents editing via the UI. That seems like a *really* great thing to have for features module; actually, it'd be nice to set that on export so sites using the feature cannot edit, but those creating it can.. hm. that's a pipe dream and not sure how that'd even work correct.
Comment #3
Dave ReidThis has worked just fine so far with local testing. Features shouldn't add locked by default but it is something interesting to consider down the road.
Comment #4
mpotter CreditAttribution: mpotter commentedI agree that this was probably a left over from the past. Committed and pushed in c39f5a9. Marking as fixed but if somebody thinks this can also safely be done in D6, feel free to port the patch and reopen this.