Incorrect response status code handling

Created on 14 July 2025, 14 days ago

Problem/Motivation

The tombstones_node_view function has the following code:

    $build['#attached']['http_header'][] = ['Status', '410 Gone'];

This causes the following error:

TypeError: Symfony\Component\HttpFoundation\Response::setStatusCode(): Argument #1 ($code) must be of type int, string given, called in /var/www/html/web/core/lib/Drupal/Core/Render/HtmlResponseAttachmentsProcessor.php on line 386 in Symfony\Component\HttpFoundation\Response->setStatusCode() (line 498 of /var/www/html/vendor/symfony/http-foundation/Response.php).

The response code should be just '410', not '410 Gone'.

Steps to reproduce

Open the Tombstone node page, and observe the behavior.
This is likely a change in Symfony Foundation that's enforcing the type check.

Proposed resolution

Replace the '410 Gone' with just 410.

Remaining tasks

Apply the fix.

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine abramm Lutsk

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024