Commit e932d839 authored by Kurt Trowbridge's avatar Kurt Trowbridge Committed by George
Browse files

Issue #3238697: Add core version requirement support for drupal 9

parent 7af58d01
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@ name: Cloudfront Edge Caching
type: module
description: Invalidate cache pages in Amazon Cloudfront
package: Services
core: 8.x
# core: 8.x
core_version_requirement: ^8 || ^9
configure: cec.admin
dependencies:
+2 −2
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ function cloudfront_edge_caching_entity_update(EntityInterface $entity) {
    $entity_type = $entity->getEntityTypeId();

    if ($enable_auto_clear_cache_content['cec_auto_cache'] && $entity_type == 'node') {
      $path_url = \Drupal::service('path.alias_manager')->getAliasByPath('/node/' . $entity->id());
      $path_url = \Drupal::service('path_alias.manager')->getAliasByPath('/node/' . $entity->id());

      // Test connection.
      $test_connection_cec = cloudfront_edge_caching_test_connection($config->get('cec_region'), $config->get('cec_key'), $config->get('cec_secret'));
@@ -52,7 +52,7 @@ function cloudfront_edge_caching_entity_update(EntityInterface $entity) {
      }
    }
    elseif ($enable_auto_clear_cache_users['cec_auto_cache'] && $entity_type == 'user') {
      $path_url = \Drupal::service('path.alias_manager')->getAliasByPath('/user/' . $entity->id());
      $path_url = \Drupal::service('path_alias.manager')->getAliasByPath('/user/' . $entity->id());

      // Test connection.
      $test_connection_cec = cloudfront_edge_caching_test_connection($config->get('cec_region'), $config->get('cec_key'), $config->get('cec_secret'));
+3 −3
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ class CecAdminInvalidateUrl extends ConfigFormBase {

    // Check if the credentials are configured.
    if (!$config->get('cec_region' && !$config->get('cec_key') && !$config->get('cec_secret'))) {
      drupal_set_message($this->t('You must configure the Global Settings correctly before execute an invalidation.'), 'error');
      $this->messenger()->addError($this->t('You must configure the Global Settings correctly before execute an invalidation.'), 'error');
    }

    else {
@@ -97,10 +97,10 @@ class CecAdminInvalidateUrl extends ConfigFormBase {
      list($status, $message) = cloudfront_edge_caching_invalidate_url($paths);

      if ($status == TRUE) {
        drupal_set_message($this->t('You invalidation is in progress.'), 'status');
        $this->messenger()->addStatus($this->t('You invalidation is in progress.'), 'status');
      }
      else {
        drupal_set_message($this->t($message), 'error');
        $this->messenger()->addError($this->t($message), 'error');
      }
    }
  }