From 5b90a6a03c1c711f2b8294b5a429c14ac574cbf2 Mon Sep 17 00:00:00 2001 From: Mike Decker Date: Mon, 18 Mar 2024 11:35:21 -0700 Subject: [PATCH] 9.6.3 --- CHANGELOG.md | 6 ++++++ modules/jumpstart_ui/jumpstart_ui.info.yml | 2 +- .../stanford_basic_page_types.info.yml | 2 +- .../stanford_courses_importer.info.yml | 2 +- .../stanford_courses.info.yml | 2 +- .../stanford_date_formats.info.yml | 2 +- .../stanford_decoupled.info.yml | 2 +- .../stanford_events_importer.info.yml | 2 +- .../stanford_events_series.info.yml | 2 +- .../stanford_events/stanford_events.info.yml | 2 +- .../stanford_image_styles.info.yml | 2 +- .../stanford_intranet.info.yml | 2 +- modules/stanford_news/stanford_news.info.yml | 2 +- .../stanford_notifications.info.yml | 2 +- .../stanford_paragraph_card.info.yml | 2 +- .../stanford_person_importer.info.yml | 2 +- .../stanford_person/stanford_person.info.yml | 2 +- .../stanford_profile_drush.info.yml | 2 +- .../stanford_profile_styles.info.yml | 2 +- .../stanford_publication.info.yml | 2 +- .../stanford_text_editor.info.yml | 2 +- stanford_profile_helper.info.yml | 2 +- stanford_profile_helper.module | 21 +++++++++++++------ 23 files changed, 42 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c6b3e65..9b43c980 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ _Release Date: 2024-03-17_ - Allow heading block to be visually hidden in layout builder. +9.6.3 +-------------------------------------------------------------------------------- +_Release Date: 2024-03-18_ + +- Improve algolia data with urls. + 9.6.2 -------------------------------------------------------------------------------- _Release Date: 2024-03-18_ diff --git a/modules/jumpstart_ui/jumpstart_ui.info.yml b/modules/jumpstart_ui/jumpstart_ui.info.yml index 99ff2587..000dc506 100755 --- a/modules/jumpstart_ui/jumpstart_ui.info.yml +++ b/modules/jumpstart_ui/jumpstart_ui.info.yml @@ -2,7 +2,7 @@ name: 'Jumpstart UI' type: module description: 'Provides UI Tools for Jumpstart Projects' package: Stanford -version: 9.6.2 +version: 9.6.3 core_version_requirement: ^9 || ^10 dependencies: - components:components diff --git a/modules/stanford_basic_page_types/stanford_basic_page_types.info.yml b/modules/stanford_basic_page_types/stanford_basic_page_types.info.yml index d6df5b04..ed0c4fc6 100644 --- a/modules/stanford_basic_page_types/stanford_basic_page_types.info.yml +++ b/modules/stanford_basic_page_types/stanford_basic_page_types.info.yml @@ -1,6 +1,6 @@ name: 'Stanford Basic Page Types' description: 'Provides support for basic page types in stanford_page nodes' -version: 9.6.2 +version: 9.6.3 core_version_requirement: ^9 || ^10 type: module project: Stanford diff --git a/modules/stanford_courses/modules/stanford_courses_importer/stanford_courses_importer.info.yml b/modules/stanford_courses/modules/stanford_courses_importer/stanford_courses_importer.info.yml index 2999b0c2..55b91ecc 100644 --- a/modules/stanford_courses/modules/stanford_courses_importer/stanford_courses_importer.info.yml +++ b/modules/stanford_courses/modules/stanford_courses_importer/stanford_courses_importer.info.yml @@ -3,7 +3,7 @@ type: module description: 'Courses Migration Importer' core_version_requirement: ^9 || ^10 package: Stanford -version: 9.6.2 +version: 9.6.3 dependencies: - stanford_courses:stanford_courses - migrate_tools:migrate_tools diff --git a/modules/stanford_courses/stanford_courses.info.yml b/modules/stanford_courses/stanford_courses.info.yml index 1b47a837..2d458ebd 100644 --- a/modules/stanford_courses/stanford_courses.info.yml +++ b/modules/stanford_courses/stanford_courses.info.yml @@ -2,7 +2,7 @@ name: 'Stanford Courses' type: module description: 'Courses content type' core_version_requirement: ^9 || ^10 -version: 9.6.2 +version: 9.6.3 package: Stanford dependencies: - config_pages:config_pages diff --git a/modules/stanford_date_formats/stanford_date_formats.info.yml b/modules/stanford_date_formats/stanford_date_formats.info.yml index 751fff43..316c819f 100644 --- a/modules/stanford_date_formats/stanford_date_formats.info.yml +++ b/modules/stanford_date_formats/stanford_date_formats.info.yml @@ -2,5 +2,5 @@ name: 'Stanford Date Formats' description: 'Date and time formats used by Stanford modules and Themes' type: module core_version_requirement: ^9 || ^10 -version: 9.6.2 +version: 9.6.3 package: Stanford diff --git a/modules/stanford_decoupled/stanford_decoupled.info.yml b/modules/stanford_decoupled/stanford_decoupled.info.yml index 817ac5ea..8178db21 100644 --- a/modules/stanford_decoupled/stanford_decoupled.info.yml +++ b/modules/stanford_decoupled/stanford_decoupled.info.yml @@ -3,7 +3,7 @@ type: module description: 'JsonAPI and GraphQL helper for decoupled sites.' core_version_requirement: ^9 || ^10 package: Stanford -version: 9.6.2 +version: 9.6.3 dependencies: - graphql_compose:graphql_compose_layout_paragraphs - graphql_compose:graphql_compose_menus diff --git a/modules/stanford_events/modules/stanford_events_importer/stanford_events_importer.info.yml b/modules/stanford_events/modules/stanford_events_importer/stanford_events_importer.info.yml index 773279f0..5b6e74a6 100644 --- a/modules/stanford_events/modules/stanford_events_importer/stanford_events_importer.info.yml +++ b/modules/stanford_events/modules/stanford_events_importer/stanford_events_importer.info.yml @@ -2,7 +2,7 @@ name: 'Stanford Events Importer' core_version_requirement: ^9 || ^10 description: 'Migrate importer for stanford events.' type: module -version: 9.6.2 +version: 9.6.3 package: 'Stanford' dependencies: - config_pages:config_pages diff --git a/modules/stanford_events/modules/stanford_events_series/stanford_events_series.info.yml b/modules/stanford_events/modules/stanford_events_series/stanford_events_series.info.yml index 0374bae8..26de5b96 100644 --- a/modules/stanford_events/modules/stanford_events_series/stanford_events_series.info.yml +++ b/modules/stanford_events/modules/stanford_events_series/stanford_events_series.info.yml @@ -2,7 +2,7 @@ name: 'Stanford Events Series' core_version_requirement: ^9 || ^10 description: 'A series is a collection of events.' type: module -version: 9.6.2 +version: 9.6.3 package: 'Stanford' dependencies: - stanford_events:stanford_events diff --git a/modules/stanford_events/stanford_events.info.yml b/modules/stanford_events/stanford_events.info.yml index 35de7f30..250f3572 100755 --- a/modules/stanford_events/stanford_events.info.yml +++ b/modules/stanford_events/stanford_events.info.yml @@ -3,7 +3,7 @@ type: module description: 'Event content type, views, and importer.' core_version_requirement: ^9 || ^10 package: Stanford -version: 9.6.2 +version: 9.6.3 dependencies: - address:address - allowed_formats:allowed_formats diff --git a/modules/stanford_image_styles/stanford_image_styles.info.yml b/modules/stanford_image_styles/stanford_image_styles.info.yml index 6953f5dc..ebbbc1ed 100755 --- a/modules/stanford_image_styles/stanford_image_styles.info.yml +++ b/modules/stanford_image_styles/stanford_image_styles.info.yml @@ -3,7 +3,7 @@ type: module description: 'Provides Image Styles' core_version_requirement: ^9 || ^10 package: Stanford -version: 9.6.2 +version: 9.6.3 dependencies: - drupal:image - drupal:responsive_image diff --git a/modules/stanford_intranet/stanford_intranet.info.yml b/modules/stanford_intranet/stanford_intranet.info.yml index a408bd86..5a968e84 100644 --- a/modules/stanford_intranet/stanford_intranet.info.yml +++ b/modules/stanford_intranet/stanford_intranet.info.yml @@ -1,6 +1,6 @@ name: 'Stanford Intranet' description: 'Locks down access to the entire site if configured.' -version: 9.6.2 +version: 9.6.3 core_version_requirement: ^9 || ^10 type: module project: Stanford diff --git a/modules/stanford_news/stanford_news.info.yml b/modules/stanford_news/stanford_news.info.yml index 099cd613..b2ba3f3e 100644 --- a/modules/stanford_news/stanford_news.info.yml +++ b/modules/stanford_news/stanford_news.info.yml @@ -3,7 +3,7 @@ type: module description: 'Stanford news items and views.' core_version_requirement: ^9 || ^10 package: Stanford -version: 9.6.2 +version: 9.6.3 dependencies: - allowed_formats:allowed_formats - auto_entitylabel:auto_entitylabel diff --git a/modules/stanford_notifications/stanford_notifications.info.yml b/modules/stanford_notifications/stanford_notifications.info.yml index 204b94b7..165671b8 100755 --- a/modules/stanford_notifications/stanford_notifications.info.yml +++ b/modules/stanford_notifications/stanford_notifications.info.yml @@ -2,7 +2,7 @@ name: Stanford Notifications description: Display a notification icon to the users when something in the platform has changed. core_version_requirement: ^9 || ^10 type: module -version: 9.6.2 +version: 9.6.3 package: Stanford dependencies: - drupal:user diff --git a/modules/stanford_paragraph_card/stanford_paragraph_card.info.yml b/modules/stanford_paragraph_card/stanford_paragraph_card.info.yml index d8e4f2f6..198a2f56 100644 --- a/modules/stanford_paragraph_card/stanford_paragraph_card.info.yml +++ b/modules/stanford_paragraph_card/stanford_paragraph_card.info.yml @@ -1,6 +1,6 @@ name: 'Stanford Paragraph Card' description: 'Adds helpers and modifications to the card paragraph type.' -version: 9.6.2 +version: 9.6.3 core_version_requirement: ^9 || ^10 type: module project: Stanford diff --git a/modules/stanford_person/modules/stanford_person_importer/stanford_person_importer.info.yml b/modules/stanford_person/modules/stanford_person_importer/stanford_person_importer.info.yml index d09bf56b..e7c7aea9 100644 --- a/modules/stanford_person/modules/stanford_person_importer/stanford_person_importer.info.yml +++ b/modules/stanford_person/modules/stanford_person_importer/stanford_person_importer.info.yml @@ -3,7 +3,7 @@ type: module description: 'Migration support for importing of profile information from stanford.edu.' core_version_requirement: ^9 || ^10 package: Stanford -version: 9.6.2 +version: 9.6.3 dependencies: - 'config_pages:config_pages' - 'drupal:migrate' diff --git a/modules/stanford_person/stanford_person.info.yml b/modules/stanford_person/stanford_person.info.yml index fb11b89b..8d08a92c 100755 --- a/modules/stanford_person/stanford_person.info.yml +++ b/modules/stanford_person/stanford_person.info.yml @@ -3,7 +3,7 @@ type: module description: 'A person bio and supporting information content type' core_version_requirement: ^9 || ^10 package: Stanford -version: 9.6.2 +version: 9.6.3 dependencies: - allowed_formats:allowed_formats - auto_entitylabel:auto_entitylabel diff --git a/modules/stanford_profile_drush/stanford_profile_drush.info.yml b/modules/stanford_profile_drush/stanford_profile_drush.info.yml index 6c51f089..4fb7aeb7 100644 --- a/modules/stanford_profile_drush/stanford_profile_drush.info.yml +++ b/modules/stanford_profile_drush/stanford_profile_drush.info.yml @@ -1,6 +1,6 @@ name: 'Stanford Profile Drush' description: 'A collection of Drush commands since commands in the profile are not discoverable.' -version: 9.6.2 +version: 9.6.3 core_version_requirement: ^9 || ^10 type: module project: Stanford diff --git a/modules/stanford_profile_styles/stanford_profile_styles.info.yml b/modules/stanford_profile_styles/stanford_profile_styles.info.yml index c3da689b..eb6c3d8c 100644 --- a/modules/stanford_profile_styles/stanford_profile_styles.info.yml +++ b/modules/stanford_profile_styles/stanford_profile_styles.info.yml @@ -1,6 +1,6 @@ name: 'Stanford Profile Styles' description: 'A module for theming' -version: 9.6.2 +version: 9.6.3 core_version_requirement: ^9 || ^10 type: module project: Stanford diff --git a/modules/stanford_publication/stanford_publication.info.yml b/modules/stanford_publication/stanford_publication.info.yml index b3d9fe10..da90bb93 100644 --- a/modules/stanford_publication/stanford_publication.info.yml +++ b/modules/stanford_publication/stanford_publication.info.yml @@ -3,7 +3,7 @@ type: module description: "Stanford Publications Module." core_version_requirement: ^9 || ^10 package: Stanford -version: 9.6.2 +version: 9.6.3 dependencies: - ctools:ctools - drupal:layout_builder diff --git a/modules/stanford_text_editor/stanford_text_editor.info.yml b/modules/stanford_text_editor/stanford_text_editor.info.yml index 4536d934..34db306d 100755 --- a/modules/stanford_text_editor/stanford_text_editor.info.yml +++ b/modules/stanford_text_editor/stanford_text_editor.info.yml @@ -2,5 +2,5 @@ name: 'Stanford Text Editor' description: 'Input formats and WYSIWYG settings' type: module core_version_requirement: ^9 || ^10 -version: 9.6.2 +version: 9.6.3 package: Stanford diff --git a/stanford_profile_helper.info.yml b/stanford_profile_helper.info.yml index cebf70ad..2f660156 100644 --- a/stanford_profile_helper.info.yml +++ b/stanford_profile_helper.info.yml @@ -3,7 +3,7 @@ type: module description: 'Stanford Profile Helper Module.' core_version_requirement: ^9 || ^10 package: Stanford -version: 9.6.2 +version: 9.6.3 dependencies: - admin_toolbar:admin_toolbar - admin_toolbar:admin_toolbar_tools diff --git a/stanford_profile_helper.module b/stanford_profile_helper.module index 54aee9ef..e6551253 100644 --- a/stanford_profile_helper.module +++ b/stanford_profile_helper.module @@ -1167,19 +1167,28 @@ function stanford_profile_helper_filter_format_access(EntityInterface $entity, $ function stanford_profile_helper_search_api_algolia_objects_alter(array &$objects, IndexInterface $index, array $items) { /** @var \Drupal\config_pages\ConfigPagesLoaderServiceInterface $config_page_loader */ $config_page_loader = \Drupal::service('config_pages.loader'); + // If the canonical url is set, use that to adjust the urls. + $site_domain = $config_page_loader->getValue('stanford_basic_site_settings', 'su_site_url', 0, 'uri'); + $current_host = \Drupal::request()->getSchemeAndHttpHost(); foreach ($objects as &$item) { // Remove fields that aren't necessary. unset($item['search_api_id'], $item['search_api_datasource'], $item['search_api_language']); - if (!isset($item['photo'])) { + + // Either the canonical url hasn't been set, or it matches the current + // request. It would match the current request when the event is happening + // in the UI. If cron is running, the current host won't match the canonical + // url. + if (!$site_domain || $site_domain == $current_host) { continue; } - // If the canonical url is set, use that to adjust the photo url. - $site_domain = $config_page_loader->getValue('stanford_basic_site_settings', 'su_site_url', 0, 'uri'); - if ($site_domain && !str_contains($item['photo'], $site_domain)) { - $photo_url = parse_url($item['photo']); - $item['photo'] = str_replace($photo_url['scheme'] . '://' . $photo_url['host'], $site_domain, $item['photo']); + // Change the urls from the current host to the canonical url. + foreach ($item as &$field) { + if (!is_string($field) || !str_contains($field, $current_host)) { + continue; + } + $field = str_replace($current_host, $site_domain, $field); } } }