Skip to content

Commit

Permalink
more caching stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
qadan committed Jul 31, 2020
1 parent 47ba163 commit 0ac5e56
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 deletions.
25 changes: 9 additions & 16 deletions src/Entity/EmbargoesEmbargoEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,22 +105,6 @@ class EmbargoesEmbargoEntity extends ConfigEntityBase implements EmbargoesEmbarg
*/
protected $notification_status;

/**
* {@inheritdoc}
*/
public function save() {
parent::save();
drupal_flush_all_caches();
}

/**
* {@inheritdoc}
*/
public function delete() {
parent::delete();
drupal_flush_all_caches();
}

/**
* {@inheritdoc}
*/
Expand Down Expand Up @@ -287,4 +271,13 @@ public function setNotificationStatus($status) {
return $this;
}

/**
* {@inheritdoc}
*/
public function getCacheTagsToInvalidate() {
$tags = parent::getCacheTagsToInvalidate[];
$tags[] = "node:{$this->getEmbargoedNode()}";
return $tags;
}

}
1 change: 0 additions & 1 deletion src/Form/EmbargoesSettingsForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
$config->set('embargo_contact_email', $form_state->getValue('embargo_contact_email'));
$config->save();
parent::submitForm($form, $form_state);
drupal_flush_all_caches();
}

}

0 comments on commit 0ac5e56

Please sign in to comment.