Skip to content

Commit

Permalink
Merge pull request #23 from ASUWebPlatforms/ws2-1314-fix-local-search…
Browse files Browse the repository at this point in the history
…-fallback

WS2-1314 fix local search fallback
  • Loading branch information
mlsamuelson authored Apr 22, 2022
2 parents fd2b802 + 570e731 commit 5f64138
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Form/AsuBrandSettingsForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'#title' => $this->t('Local Search URL'),
'#default_value' => $config->get('asu_brand.asu_brand_local_search_url'),
'#description' => $this->t('If empty, your current site\'s base URL will be used. Optionally, you can override
with the URL of your choice to be used for scoping local search. Use the format: https://yourdomain.asu.edu.'),
with the URL of your choice to be used for scoping local search. Use the format: yourdomain.asu.edu'),
];

return parent::buildForm($form, $form_state);
Expand Down
3 changes: 2 additions & 1 deletion src/Plugin/Block/AsuBrandHeaderBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ public function build() {
// Search settings.
$search_config = \Drupal::config('asu_brand.settings');
$props['searchUrl'] = $search_config->get('asu_brand.asu_brand_search_url');
$props['site'] = $search_config->get('asu_brand.asu_brand_local_search_url');
$local_search_url = $search_config->get('asu_brand.asu_brand_local_search_url');
$props['site'] = strlen($local_search_url) ? $local_search_url : \Drupal::request()->getHost();

$block_output = [];
// Markup containers where components will initialize.
Expand Down

0 comments on commit 5f64138

Please sign in to comment.