From bbd17bc70f387b717b83fdb80fe43c066453d2c5 Mon Sep 17 00:00:00 2001 From: btopro <btopro@outlook.com> Date: Thu, 2 Apr 2020 09:08:19 -0400 Subject: [PATCH] psu cdn updated to cloudfront --- webcomponents.install | 9 +++++++++ webcomponents.module | 6 +++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/webcomponents.install b/webcomponents.install index d4cdb68..fff5958 100755 --- a/webcomponents.install +++ b/webcomponents.install @@ -148,4 +148,13 @@ function webcomponents_update_7000(&$sandbox) { */ function webcomponents_install() { _webcomponents_rebuild(TRUE); +} + +/** + * PSU CDN moved so if old valid move to the new one + */ +function webcomponents_update_7001(&$sandbox) { + if (variable_get('webcomponents_project_location', 'https://cdn.webcomponents.psu.edu/cdn/') == 'https://webcomponents.psu.edu/cdn/') { + variable_set('webcomponents_project_location', 'https://cdn.webcomponents.psu.edu/cdn/'); + } } \ No newline at end of file diff --git a/webcomponents.module b/webcomponents.module index e9d3e5e..0ce9d29 100755 --- a/webcomponents.module +++ b/webcomponents.module @@ -29,9 +29,9 @@ function webcomponents_admin_settings($form, &$form_state) { $form['webcomponents_project_location'] = [ '#type' => 'select', '#title' => t('Webcomponents Location'), - '#default_value' => variable_get('webcomponents_project_location', 'https://webcomponents.psu.edu/cdn/'), + '#default_value' => variable_get('webcomponents_project_location', 'https://cdn.webcomponents.psu.edu/cdn/'), '#options' => array( - 'https://webcomponents.psu.edu/cdn/' => 'Penn State CDN', + 'https://cdn.webcomponents.psu.edu/cdn/' => 'Penn State CDN', 'https://cdn.waxam.io/' => 'Waxam CDN', 'sites/all/libraries/webcomponents/' => 'Local libraries folder (sites/all/libraries/webcomponents/)', 'other' => t('Other'), @@ -52,7 +52,7 @@ function webcomponents_admin_settings($form, &$form_state) { * Implements hook_process_html(). */ function webcomponents_process_html(&$variables) { - $location = variable_get('webcomponents_project_location', 'https://webcomponents.psu.edu/cdn/'); + $location = variable_get('webcomponents_project_location', 'https://cdn.webcomponents.psu.edu/cdn/'); if ($location == 'other') { $location = variable_get('webcomponents_project_location_other', ''); } -- GitLab