Absolute view path causes error in suggestion link

Created on 11 September 2023, over 1 year ago
Updated 15 September 2023, over 1 year ago

Problem/Motivation

We have a multi-language site and our view paths are absolute. We want to use the "Did you mean?" display option. Our absolute view path is causing an error in getSuggestionLink() in src/Plugin/views/area/DidYouMeanSpellCheck.php, as Drupal\Core\Url::fromUserInput() won't accept an absolute path.

The error displayed is:
InvalidArgumentException: The user-entered string must begin with a '/', '?', or '#'. in Drupal\Core\Url::fromUserInput() (line 216 of /opt/drupal/web/core/lib/Drupal/Core/Url.php).

Steps to reproduce

Use the "Did you mean?" display option with a view that has an absolute path.

Proposed resolution

Ensure the view path is relative before it is processed.

🐛 Bug report
Status

Active

Version

4.0

Component

Code

Created by

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

Comments & Activities

Production build 0.71.5 2024