Drupal 11: Call to undefined method FileSecurity::writeWebConfig()

Created on 10 July 2024, 5 months ago
Updated 29 July 2024, 5 months ago

Problem/Motivation

Was trying to set up simple_oauth on a fresh Drupal 11 system, and going to generate public and private keys. When saving the keys, I get an error:

Error: Call to undefined method Drupal\\Component\\FileSecurity\\FileSecurity::writeWebConfig() in /app/web/modules/contrib/simple_oauth/src/Service/KeyGeneratorService.php on line 76

This is called in KeyGeneratorService::generateKeys():

FileSecurity::writeWebConfig($dir_path);

FileSecurity::writeWebConfig appears to have been entirely removed for Drupal 11: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Component%21File...

I don't see any evidence it was ever deprecated in Drupal 10: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Component%21File...

Steps to reproduce

Install simple_oauth on Drupal 11.
Attempt to generate keys at /admin/config/people/simple_oauth

Proposed resolution

Unknown - I can comment the line out and it appears to work.
The release notes for Drupal 11 make reference to web.config being removed: https://www.drupal.org/project/drupal/releases/11.0.0-beta1

Maybe make a call to method_exists()?

🐛 Bug report
Status

Fixed

Version

6.0

Component

Code

Created by

🇨🇦Canada TrevorBradley

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