Problem/Motivation

I have a view with display block that have a contextual filter using the default argument "Active menu item ID".

The view disappears if the url contains any query string.

Steps to reproduce

Create a block display of a view. Add the default value "Active menu item ID" when the filter is not in url.
Create a page with menu entry and place the block in it.
Access to the page with any query string.

/my-page
works
/my-page?a=b
doesn't work

Proposed resolution

Read current path from:
$current_path = $this->currentRequest->getPathInfo();

instead of
$current_path = $this->currentRequest->getRequestUri();

Patch attached

CommentFileSizeAuthor
menu_active_id_pathinfo.patch788 bytesmikcat

Comments

mikcat created an issue. See original summary.

ozin’s picture

Status: Active » Needs review

  • ozin committed a66a363 on 8.x-2.x authored by mikcat
    Issue #3276431 by mikcat: Active menu item ID views argument default not...
ozin’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.