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()?

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

TrevorBradley created an issue. See original summary.

trevorbradley’s picture

Wrote up a hopefully polite documentation complaint on the D11 documentation queue here: https://www.drupal.org/project/drupal/issues/3460690

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

ankitv18’s picture

Status: Active » Needs review

Please review the MR!137 as the mentioned menthod is deprecated in D11 it is required to include this before stable release.

bojan_dev’s picture

Status: Needs review » Fixed

@TrevorBradley tnx for the headsup and @ankitv18 tnx for the MR!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.