Error with views block display

Created on 17 March 2022, over 3 years ago
Updated 5 June 2025, 4 months ago

Problem/Motivation

When rendering views display block wich not contains path, we get a fatal error :
InvalidArgumentException: You cannot create a URL to a display without routes. in Drupal\views\ViewExecutable->getUrl() (line 1939 of core/modules/views/src/ViewExecutable.php).

Steps to reproduce

Create a view with page display and a path.
Create in this view a block display with More link option enabled and Link display option set to None.

When rendering the render array returned by function views_embed_view('view_machine_name', 'block_1'), the error occured.

Proposed resolution

When remove the code from the patch provided in the issue 2979690 πŸ› Incorrect form action URL for views that have page displays Fixed , the error disappear.
The new getLinkDisplay method in ViewsBlockFilterBlockPluginDisplayBlock class remove functionnality provided by core and is the cause of the error.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡«πŸ‡·France klelostec

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024