Skip to content

Commit

Permalink
Merge pull request #201 from dof-dss/development
Browse files Browse the repository at this point in the history
Merge dev into main for release
  • Loading branch information
neilblair authored Feb 22, 2022
2 parents 3f4bda7 + ed1fa3d commit 17de025
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions origins_media/origins_media.module
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,20 @@ function origins_media_form_alter(&$form, FormStateInterface $form_state, $form_
}
}

/**
* Implements hook_ENTITY_TYPE_delete().
*/
function origins_media_file_delete(EntityInterface $entity) {
// Purge file URL from Fastly.
$url = $entity->createFileUrl($relative = FALSE);
if (!empty(\Drupal::hasService('fastly.api'))) {
$fastly = Drupal::service('fastly.api');
if (!empty($url)) {
$fastly->purgeUrl($url);
}
}
}

/**
* Implements hook_preprocess_views_view_field().
*
Expand Down

0 comments on commit 17de025

Please sign in to comment.