I'm creating a Drupal install profile/distribution for a client and create some custom node types with 'locked' => TRUE so they can't be deleted and thought it would be cool to have a clean way to programmatically create certain fields for those content types and allow fields to be locked on a certain content type. I know we can drupal_execute() to do the fields so that is good enough for now, but is there a way to lock fields? My main feature request is to prevent field deletion and hardcode the field machine name. Thanks.

Comments

RobRoy’s picture

A cool use case would be for an event node type created by calendar.module which creates and locks a date field to the node.

catch’s picture

Version: 5.x-1.x-dev » 6.x-1.x-dev

Still valid afaik. Bumping this so it can be marked duplicate of whatever issue has this in more depth later.

yched’s picture

Status: Active » Closed (won't fix)

We don't exactly have hook-defined fields *yet*, but when we do, all module-defined fields will be locked (instance level settings like Label, weight, widgets, formatters will still be editable).

Not sure what to to with the issue, though. In the current state of things, it's a won't fix...

aaron’s picture

Status: Closed (won't fix) » Postponed

we need this for a stable image module to image field module migration path as well. bumping this to postpone. for now, we'll simply use form_alters, will post a work-around for this later for interested folks.

karens’s picture

Simple locking has been added. More could be done later.

karens’s picture

Status: Postponed » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

junro’s picture

Category: feature » support
Status: Closed (fixed) » Active

Hello,

Is there a way to lock fields now? or it's still impossible ?

When a field has a value, I would like to lock this field to authenticated users. That they could not change the value again.

I'm looking for this since a long time.

Is there a way to do this? Something like when the field has a value, permissions are removed for authenticated users.

Thanks :)

zeezhao’s picture

Also interested in this. Please let me know if you were bale to get resolved.