Skip to main content
5 of 5
edited tags
avpaderno
  • 97.9k
  • 15
  • 164
  • 284

Alternative to field_attach_update

In Drupal 7 we were able to use field_attach_update($entity_type, $entity) to update fields without having the need to update the whole node. $node->save() is very heavy and calls many hooks in between.

With the coming of Drupal 8, field_attach_update was deprecated. Is there an alternative to it, and what is it if yes?

In my case I'm updating two image fields programatically and don't want to call $node->save in order to not trigger all the other hooks.

113408
  • 326
  • 3
  • 13