Views: "More link" URL contains exposed filter parameters when using the "Custom URL" option

Created on 29 June 2023, almost 2 years ago
Updated 11 September 2023, over 1 year ago

Problem/Motivation

Exposed filter parameters are added to the "More link" when it uses the "Custom URL" option.
Expected behavior:
If we enable "More link" with the option custom URL then it should not add any exposed filter parameters to the "More link"

Steps to reproduce

  • Create a view(block).
  • Add a filter and expose it.
  • Enable "More link" to the view and select the "Custom URL" option on the "Link display", and add any URL(http://example.com) and then save it.
  • Update the preview and check the more link.

we can see that exposed filter parameters are available on the more link
eg: http://example.com?filter_identifier=value

Proposed resolution

Don't merge exposed filter parameters to "More link" if the selected "Link display" option is "Custom URL"
(getMoreUrl() function)
current code

    // Merge the exposed query parameters.
    if (!empty($this->view->exposed_raw_input)) {
      $url->mergeOptions(['query' => $this->view->exposed_raw_input]);
    }

proposed code

    $link_display = $this->getOption('link_display');
    if ($link_display !== 'custom_url' && !empty($this->view->exposed_raw_input)) {
       $url->mergeOptions(['query' => $this->view->exposed_raw_input]);
     }

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

โœจ Feature request
Status

Needs work

Version

11.0 ๐Ÿ”ฅ

Component
Viewsย  โ†’

Last updated about 13 hours ago

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia ranjith_kumar_k_u Kerala

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024