From 6c91bb774c29d6f33a85abce7a49c5b99f31d1f3 Mon Sep 17 00:00:00 2001 From: Alex Pott <alex.a.pott@googlemail.com> Date: Tue, 17 Feb 2015 00:34:34 +0000 Subject: [PATCH] Issue #2427001 by chx: field item presave is only called for SQL --- .../Drupal/Core/Entity/ContentEntityStorageBase.php | 10 ++++++++++ .../Drupal/Core/Entity/Sql/SqlContentEntityStorage.php | 10 ---------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php b/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php index 3a6517652bac..dee07c1da4f0 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php @@ -179,6 +179,16 @@ protected function invokeTranslationHooks(ContentEntityInterface $entity) { } } + /** + * {@inheritdoc} + */ + protected function invokeHook($hook, EntityInterface $entity) { + if ($hook == 'presave') { + $this->invokeFieldMethod('preSave', $entity); + } + parent::invokeHook($hook, $entity); + } + /** * Invokes a method on the Field objects within an entity. * diff --git a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php index be6ff7f82208..8a5a4a773769 100644 --- a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php +++ b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php @@ -1055,16 +1055,6 @@ protected function savePropertyData(EntityInterface $entity, $table_name = NULL) $query->execute(); } - /** - * {@inheritdoc} - */ - protected function invokeHook($hook, EntityInterface $entity) { - if ($hook == 'presave') { - $this->invokeFieldMethod('preSave', $entity); - } - parent::invokeHook($hook, $entity); - } - /** * Maps from an entity object to the storage record. * -- GitLab