Skip to content

Commit 5f64138

Browse files
authored
Merge pull request #23 from ASUWebPlatforms/ws2-1314-fix-local-search-fallback
WS2-1314 fix local search fallback
2 parents fd2b802 + 570e731 commit 5f64138

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Form/AsuBrandSettingsForm.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
108108
'#title' => $this->t('Local Search URL'),
109109
'#default_value' => $config->get('asu_brand.asu_brand_local_search_url'),
110110
'#description' => $this->t('If empty, your current site\'s base URL will be used. Optionally, you can override
111-
with the URL of your choice to be used for scoping local search. Use the format: https://yourdomain.asu.edu.'),
111+
with the URL of your choice to be used for scoping local search. Use the format: yourdomain.asu.edu'),
112112
];
113113

114114
return parent::buildForm($form, $form_state);

src/Plugin/Block/AsuBrandHeaderBlock.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ public function build() {
112112
// Search settings.
113113
$search_config = \Drupal::config('asu_brand.settings');
114114
$props['searchUrl'] = $search_config->get('asu_brand.asu_brand_search_url');
115-
$props['site'] = $search_config->get('asu_brand.asu_brand_local_search_url');
115+
$local_search_url = $search_config->get('asu_brand.asu_brand_local_search_url');
116+
$props['site'] = strlen($local_search_url) ? $local_search_url : \Drupal::request()->getHost();
116117

117118
$block_output = [];
118119
// Markup containers where components will initialize.

0 commit comments

Comments
 (0)