Error: Call to undefined method Drupal\Core\Cache\CacheableResponse::create()

Created on 27 November 2023, 12 months ago

Problem/Motivation

When running in Drupal 10, we're getting the following error being logged to watchdog, on any api_proxy API response:

Error: Call to undefined method Drupal\Core\Cache\CacheableResponse::create() in Drupal\api_proxy\Plugin\HttpApiPluginBase->corsResponse() (line 357 of /var/lib/tugboat/web/modules/contrib/api_proxy/src/Plugin/HttpApiPluginBase.php).

Steps to reproduce

Hit any API endpoint setup through api_proxy on Drupal 10.

Proposed resolution

Looks like \Symfony\Component\HttpFoundation\Response::create was deprected in Symfony 5.x and removed in 6.x, which is why the Drupal 10 upgrade missed it. Need to update our code here that uses it per the deprection notice in Symfony 5.x

Remaining tasks

Code update and test.

User interface changes

None.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇨🇦Canada m4olivei Grimsby, ON

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