Skip to content
Snippets Groups Projects
Unverified Commit 14b910b4 authored by Pieter Frenssen's avatar Pieter Frenssen :paperclips: Committed by GitHub
Browse files

Merge pull request #1161 from ec-europa/ISAICP-4468

HOTFIX: ISAICP-4468: Override base method in order to get the notifications s…
parents 6b517a93 4ac6d7ba
No related branches found
No related tags found
No related merge requests found
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
use Drupal\cached_computed_field\Event\RefreshExpiredFieldsEventInterface; use Drupal\cached_computed_field\Event\RefreshExpiredFieldsEventInterface;
use Drupal\cached_computed_field\EventSubscriber\RefreshExpiredFieldsSubscriberBase; use Drupal\cached_computed_field\EventSubscriber\RefreshExpiredFieldsSubscriberBase;
use Drupal\cached_computed_field\ExpiredItemInterface;
use Drupal\Component\Datetime\DateTimePlus; use Drupal\Component\Datetime\DateTimePlus;
use Drupal\Component\Datetime\TimeInterface; use Drupal\Component\Datetime\TimeInterface;
use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Config\ConfigFactoryInterface;
...@@ -366,4 +367,21 @@ protected function getSubQueryParameters(EntityInterface $entity, array $paramet ...@@ -366,4 +367,21 @@ protected function getSubQueryParameters(EntityInterface $entity, array $paramet
return $sub_query->getParameters(); return $sub_query->getParameters();
} }
/**
* {@inheritdoc}
*/
public function updateFieldValue(ExpiredItemInterface $expiredItem, $value) {
$request_time = $this->time->getRequestTime();
$cache_lifetime = $this->getField($expiredItem)->getSettings()['cache-max-age'];
$entity = $this->getEntity($expiredItem);
$entity->set($expiredItem->getFieldName(), [
'value' => $value,
'expire' => $request_time + $cache_lifetime,
]);
// Set the flag to skip notifications for updates performed by cron.
$entity->skip_notification = TRUE;
$entity->save();
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment