Absolute view path causes error in suggestion link

Created on 11 September 2023, 10 months ago
Updated 15 September 2023, 9 months 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.69.0 2024