Problem/Motivation

I want to redirect to a PDF file.

However in FieldRedirectionFormatter::shouldDeny() getRouteName() is called on the $redirect_url resulting in an UnexpectedValueException.

Steps to reproduce

Try to redirect to a pdf.

Proposed resolution

Only call getRouteName if url is routed. E.g.

$route_name = $redirect_url->isRouted() ? $redirect_url->getRouteName() : NULL;

CommentFileSizeAuthor
#2 field_redirection_is_routed_check.patch824 bytesdahousecat
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

dahousecat created an issue. See original summary.

dahousecat’s picture

StatusFileSize
new824 bytes

danielveza made their first commit to this issue’s fork.

larowlan made their first commit to this issue’s fork.

  • larowlan committed d45e249c on 8.x-2.x
    Issue #3541084 by dahousecat, danielveza, larowlan: Should check if URL...
larowlan’s picture

Status: Active » Fixed

Thanks. fixed, tagging 8.x-2.4

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

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

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.