Skip to main content
replaced http://drupal.stackexchange.com/ with https://drupal.stackexchange.com/
Source Link

I have upgraded a website to drupal 8 that I found a field created and I need to delete that field as it became useless.

The field is locked, and this prevents me delete it from the interface. I tried to delete it using field_purge_field(), but it didn't work either.

The answer for How to properly delete fields, programmatically?How to properly delete fields, programmatically? didn't work for me.

Edit: I tried that piece of code but didn't do any thing

$field = \Drupal::entityManager()->getStorage('field_config')->load($entity_type.$bundle_name.$field_machine_name);
field_purge_field($field);

How do I delete fields that result locked? How do I unlock them before deleting them?

I have upgraded a website to drupal 8 that I found a field created and I need to delete that field as it became useless.

The field is locked, and this prevents me delete it from the interface. I tried to delete it using field_purge_field(), but it didn't work either.

The answer for How to properly delete fields, programmatically? didn't work for me.

Edit: I tried that piece of code but didn't do any thing

$field = \Drupal::entityManager()->getStorage('field_config')->load($entity_type.$bundle_name.$field_machine_name);
field_purge_field($field);

How do I delete fields that result locked? How do I unlock them before deleting them?

I have upgraded a website to drupal 8 that I found a field created and I need to delete that field as it became useless.

The field is locked, and this prevents me delete it from the interface. I tried to delete it using field_purge_field(), but it didn't work either.

The answer for How to properly delete fields, programmatically? didn't work for me.

Edit: I tried that piece of code but didn't do any thing

$field = \Drupal::entityManager()->getStorage('field_config')->load($entity_type.$bundle_name.$field_machine_name);
field_purge_field($field);

How do I delete fields that result locked? How do I unlock them before deleting them?

Tweeted twitter.com/StackDrupal/status/726238150012616704
add code sample
Source Link

I have upgraded a website to drupal 8 that I found a field created and I need to delete that field as it became useless.

The field is locked, and this prevents me delete it from the interface. I tried to delete it using field_purge_field(), but it didn't work either.

The answer for How to properly delete fields, programmatically? didn't work for me.

Edit: I tried that piece of code but didn't do any thing

$field = \Drupal::entityManager()->getStorage('field_config')->load($entity_type.$bundle_name.$field_machine_name);
field_purge_field($field);

How do I delete fields that result locked? How do I unlock them before deleting them?

I have upgraded a website to drupal 8 that I found a field created and I need to delete that field as it became useless.

The field is locked, and this prevents me delete it from the interface. I tried to delete it using field_purge_field(), but it didn't work either.

The answer for How to properly delete fields, programmatically? didn't work for me.

How do I delete fields that result locked? How do I unlock them before deleting them?

I have upgraded a website to drupal 8 that I found a field created and I need to delete that field as it became useless.

The field is locked, and this prevents me delete it from the interface. I tried to delete it using field_purge_field(), but it didn't work either.

The answer for How to properly delete fields, programmatically? didn't work for me.

Edit: I tried that piece of code but didn't do any thing

$field = \Drupal::entityManager()->getStorage('field_config')->load($entity_type.$bundle_name.$field_machine_name);
field_purge_field($field);

How do I delete fields that result locked? How do I unlock them before deleting them?

removed tags from title
Source Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284

Drupal 8 delete field Delete locked fields, programmatically

I have upgraded a website to drupal 8 that I found a field created and I need to delete that field as it becomesbecame useless.

Problem: The The field becomesis locked which, and this prevents me delete it from the interface. I tried to delete it in code programmatically using field_purge_fieldfield_purge_field() BUt, but it didn't work.

Motivation: Edit the field settings to unlock and delete from the interface or delete it using field api either.

The answer on that question didn't work as I need to catch one field and delete itfor how-to-properly-delete-fields-programmaticallyHow to properly delete fields, programmatically? didn't work for me.

Can any body provide an example to unlock the field orHow do I delete it using its machine namefields that result locked?

Thanks in advance How do I unlock them before deleting them?

Drupal 8 delete field programmatically

I have upgraded a website to drupal 8 that I found a field created and I need to delete that field as it becomes useless.

Problem: The field becomes locked which prevents me delete it from the interface. I tried to delete it in code programmatically using field_purge_field BUt it didn't work.

Motivation: Edit the field settings to unlock and delete from the interface or delete it using field api.

The answer on that question didn't work as I need to catch one field and delete it how-to-properly-delete-fields-programmatically

Can any body provide an example to unlock the field or delete it using its machine name?

Thanks in advance

Delete locked fields, programmatically

I have upgraded a website to drupal 8 that I found a field created and I need to delete that field as it became useless.

The field is locked, and this prevents me delete it from the interface. I tried to delete it using field_purge_field(), but it didn't work either.

The answer for How to properly delete fields, programmatically? didn't work for me.

How do I delete fields that result locked? How do I unlock them before deleting them?

Source Link
Loading