Use 'search.view' instead of 'search.plugins:' . $default for base route in SearchLocalTask::getDerivativeDefinitions()

Created on 4 January 2024, 12 months ago
Updated 16 March 2024, 9 months ago

Problem/Motivation

In ๐Ÿ› Page title should contextualize the local navigation Needs work we found that the plugin IDs shouldn't be used for base route in SearchLocalTask::getDerivativeDefinitions() because plugin IDs are not a valid base route.

Steps to reproduce

Proposed resolution

  1. Add a test which shows that this is a problem
  2. Add the fix :
       public function getDerivativeDefinitions($base_plugin_definition) {
         $this->derivatives = [];
     
    -    if ($default = $this->searchPageRepository->getDefaultSearchPage()) {
    +    if ($this->searchPageRepository->getDefaultSearchPage()) {
           $active_search_pages = $this->searchPageRepository->getActiveSearchPages();
           foreach ($this->searchPageRepository->sortSearchPages($active_search_pages) as $entity_id => $entity) {
             $this->derivatives[$entity_id] = [
               'title' => $entity->label(),
               'route_name' => 'search.view_' . $entity_id,
    -          'base_route' => 'search.plugins:' . $default,
    +          'base_route' => 'search.view',
               'weight' => $entity->getWeight(),
             ];

    Use search.view instead of search.plugins:.

Remaining tasks

See #11

User interface changes

API changes

Data model changes

Release notes snippet

๐Ÿ› Bug report
Status

Fixed

Version

10.3 โœจ

Component
Searchย  โ†’

Last updated 9 days ago

  • Maintained by
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States @pwolanin
Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia kunal.sachdev

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024