diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..92d3a04 --- /dev/null +++ b/.github/workflows/lint.yml @@ -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 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index ed4d836..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,62 +0,0 @@ ---- -################################# -################################# -## Super Linter GitHub Actions ## -################################# -################################# -name: Lint Code Base - -# -# Documentation: -# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions -# - -############################# -# Start the job on all push # -############################# -on: - push: - branches: [main] - pull_request: - workflow_dispatch: - -############### -# Set the Job # -############### -jobs: - build: - # Name the Job - name: Lint Code Base - # Set the agent to run on - runs-on: ubuntu-latest - - ################## - # Load all steps # - ################## - steps: - ########################## - # Checkout the code base # - ########################## - - name: Checkout Code - uses: actions/checkout@v3 - with: - # Full git history is needed to get a proper list of changed files within `super-linter` - fetch-depth: 0 - - ################################ - # Run Linter against code base # - ################################ - - name: Lint Code Base - uses: github/super-linter/slim@v4 - env: - VALIDATE_ALL_CODEBASE: false - VALIDATE_JAVASCRIPT_ES: true - VALIDATE_CSS: true - VALIDATE_HTML: true - VALIDATE_YAML: true - VALIDATE_GITLEAKS: true - VALIDATE_GITHUB_ACTIONS: true - VALIDATE_MARKDOWN: true - VALIDATE_PHP: true - DEFAULT_BRANCH: main - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 09bdccf..b2ab075 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 --- diff --git a/src/SiteConfiguration.php b/src/SiteConfiguration.php index 3d14ef9..b9a6b59 100644 --- a/src/SiteConfiguration.php +++ b/src/SiteConfiguration.php @@ -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; @@ -57,6 +58,13 @@ class SiteConfiguration { */ protected $entityTypeRepository; + /** + * The request context. + * + * @var \Drupal\Core\Routing\RequestContext + */ + protected $requestContext; + /** * The current route match. * @@ -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 @@ -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, ) { @@ -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; } @@ -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; diff --git a/ucb_site_configuration.services.yml b/ucb_site_configuration.services.yml index 4ef0397..22f08ce 100644 --- a/ucb_site_configuration.services.yml +++ b/ucb_site_configuration.services.yml @@ -8,5 +8,6 @@ services: - '@string_translation' - '@entity_type.manager' - '@entity_type.repository' + - '@router.request_context' - '@current_route_match' - '@messenger'