Skip to content

Commit

Permalink
mainissue/65
Browse files Browse the repository at this point in the history
  • Loading branch information
timurtripp committed Oct 28, 2024
2 parents b825623 + 6f848a1 commit 2cc99ee
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 63 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Lint Code Base
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
jobs:
lint:
uses: CuBoulder/action-collection/.github/workflows/lint.yml@main
62 changes: 0 additions & 62 deletions .github/workflows/main.yml

This file was deleted.

12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- ### Prepends site base URL to site-relative search page path (v2.8.6)
[bug, severity:moderate] An issue existed where the site-relative search page path would be treated as root-relative by the browser due to a missing prefixing of the site's URL, preventing custom site search from working as expected. This update resolves the issue by correctly prefixing the site's full URL to the search page path. Resolves CuBoulder/ucb_site_configuration#69
---

- ### Updates linter workflow
Updates the linter workflow to use the new parent workflow in action-collection.

CuBoulder/action-collection#7

Sister PR in: All the things
---

- ### Create developer-sandbox-ci.yml
new ci workflow
---
Expand Down
14 changes: 13 additions & 1 deletion src/SiteConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Messenger\MessengerInterface;
use Drupal\Core\Routing\RequestContext;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;
Expand Down Expand Up @@ -57,6 +58,13 @@ class SiteConfiguration {
*/
protected $entityTypeRepository;

/**
* The request context.
*
* @var \Drupal\Core\Routing\RequestContext
*/
protected $requestContext;

/**
* The current route match.
*
Expand Down Expand Up @@ -86,6 +94,8 @@ class SiteConfiguration {
* The entity type manager.
* @param \Drupal\Core\Entity\EntityTypeRepositoryInterface $entity_type_repository
* The entity type repository.
* @param \Drupal\Core\Routing\RequestContext $request_context
* The request context.
* @param \Drupal\Core\Routing\RouteMatchInterface $current_route_match
* The current route match.
* @param \Drupal\Core\Messenger\MessengerInterface $messenger
Expand All @@ -98,6 +108,7 @@ public function __construct(
TranslationManager $string_translation,
EntityTypeManagerInterface $entity_type_manager,
EntityTypeRepositoryInterface $entity_type_repository,
RequestContext $request_context,
RouteMatchInterface $current_route_match,
MessengerInterface $messenger,
) {
Expand All @@ -107,6 +118,7 @@ public function __construct(
$this->stringTranslation = $string_translation;
$this->entityTypeManager = $entity_type_manager;
$this->entityTypeRepository = $entity_type_repository;
$this->requestContext = $request_context;
$this->currentRouteMatch = $current_route_match;
$this->messenger = $messenger;
}
Expand Down Expand Up @@ -349,7 +361,7 @@ public function attachSiteInformation(array &$variables) {
}
$searchUrl = $settings->get('site_search_url');
if ($searchUrl) {
$siteSearchOption['url'] = $searchUrl;
$siteSearchOption['url'] = $this->requestContext->getCompleteBaseUrl() . $searchUrl;
}
}
$variables['site_search'][] = $siteSearchOption;
Expand Down
1 change: 1 addition & 0 deletions ucb_site_configuration.services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ services:
- '@string_translation'
- '@entity_type.manager'
- '@entity_type.repository'
- '@router.request_context'
- '@current_route_match'
- '@messenger'

0 comments on commit 2cc99ee

Please sign in to comment.