Problem/Motivation

Preconditions: A site which uses a lazy builder to render the commerce cart form.

When pressing the Checkout button, the site crashes inside CspResponseAttachmentsProcessor on line 50 because the RedirectResponse doesn't have the setAttachments() method.

This is caused by an early return in Drupal\Core\Render\HtmlResponseAttachmentsProcessor::processAttachments() if an EnforcedResponseException is thrown while rendering placeholders.

Steps to reproduce

Proposed resolution

Only call setAttachments on responses which implement the Drupal\Core\Render\AttachmentsInterface interface.

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork csp-3585022

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

znerol created an issue. See original summary.

znerol’s picture

Status: Active » Needs work
Issue tags: +Needs tests

gapple’s picture

Status: Needs work » Fixed

Thank you

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

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

Maintainers, credit people who helped resolve this issue.

  • gapple committed e723d10b on 2.x authored by znerol
    fix: #3585022 Handle redirects caused by EnforcedResponseException in...

  • gapple committed f412e750 on 2.2.x authored by znerol
    fix: #3585022 Handle redirects caused by EnforcedResponseException in...