I want to override field_sql_storage_field_storage_write(), defined in /modules/field/modules/field_sql_storage/field_sql_storage.module.

I tried with MYMODULE_field_storage_write_alter($entity_type, $entity, $op, $fields), but it doesn't work.

How should I override that function?

  • This question has neither CODE NEED TO MODIFY embedded (why not just name the CORE function with link to api.drupal.org?) not your own effort to show what to alter. – Clemens Tolboom Aug 19 '17 at 6:39
  • done, url added – Tony Soprano Aug 19 '17 at 6:50
  • My comment above asked for what you want to accomplish in weird words ;). I added an answer but it depends on your needs. – Clemens Tolboom Aug 20 '17 at 7:49

You could try hook_field_storage_info_alter

Other candidates are

  1. hook_field_insert
  2. hook_field_update
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.