Problem/Motivation

When a view is attached in a menu,

Steps to reproduce

- Create a view (say "Content list")
- Make it a child of a node page
- The breadcrumb looks like "Home > Node page > Content list > Content list"

Note : I use a module that patches [Issue 3359511](https://www.drupal.org/project/drupal/issues/3359511)

Proposed resolution

I have no proposed resolution.

Remaining tasks

The addMissingCurrentPage method does not work well with routes generated by Views.

The following comparison seems incorrect:

$last_url->getRouteParameters() === $route_match->getRawParameters()->all()

For a View route, view_id and display_id are internal parameters of the RouteMatch, but they are not necessarily required to generate the link URL.

Therefore, the routed URL could be:

    route_name = view.content_list.page_1
    route_parameters = []

whereas the current RouteMatch contains:

    [
        'view_id' => 'content_list',
        'display_id' => 'page_1',
    ]

Drupal distinguishes between the raw route parameters of the RouteMatch and the URL generation parameters; getRawParameters() returns the raw values resulting from route matching, whilst Url::getRouteParameters() returns the parameters carried by the URL object.

From there, I do not know what to do.

Comments

zigazou created an issue. See original summary.

xurizaemon’s picture

Status: Active » Closed (duplicate)

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.