InvalidArgumentException: The internal path component is invalid.

Created on 2 August 2023, over 1 year ago

Problem/Motivation

When entering an invalid url in a link field, the form submission fails with a white screen and the following error:

InvalidArgumentException: The internal path component 'xxx' is invalid. Its path component must have a leading slash, e.g. internal:/foo. in Drupal\Core\Url::fromInternalUri() (regel 416 van /Users/dieterholvoet/Projects/sites-personal/whathappens/web/core/lib/Drupal/Core/Url.php).

Proposed resolution

LinkItemInterface::getUrl() may throw an InvalidArgumentException when there is a problem with field data. We should catch this.

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇧🇪Belgium dieterholvoet Brussels

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

Comments & Activities

Production build 0.71.5 2024