Problem/Motivation

When a views PDF can't be generated due to an error, the error handlers attempt to send a RedirectResponse to "", but passing a Url object to the symfony RedirectResponse constructor instead of a string.

$url = $executable->hasUrl() ? $executable->getUrl()->toString() : Url::fromRoute('<front>');
$event->setResponse(new RedirectResponse($url));

Steps to reproduce

Trigger an error when generating a views PDF, instead of being redirected to the homepage and see the debug output and actual errors, you will see an error along the lines of:

Recoverable fatal error: Object of class Drupal\Core\Url could not be converted to string in Drupal\Component\Utility\UrlHelper::isExternal()
CommentFileSizeAuthor
#2 3161399-2.patch1.69 KBeric115
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

Eric115 created an issue. See original summary.

eric115’s picture

Status: Active » Needs review
StatusFileSize
new1.69 KB

Patch to add ->toString();

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

jannakha’s picture

Status: Needs review » Reviewed & tested by the community

- created MR 98 out of patch
- before patch applied, exception occurs when redirecting to
- after patch applied, redirection to works as expected