Problem/Motivation

We updated a project to drupal 9.2.x and simple_oauth to 5.0.5

It generated a fatal error:
NOTICE: PHP message: PHP Fatal error: Class Drupal\simple_oauth\Authentication\TokenAuthUser contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Drupal\Core\TypedData\TranslatableInterface::setIsDefaultTranslation) in /app/web/modules/contrib/simple_oauth/src/Authentication/TokenAuthUser.php on line 18

I think we just need to add the missing method

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

Toggle MR activity

louis-cuny created an issue. See original summary.

louis-cuny’s picture

Issue summary: View changes
louis-cuny’s picture

Status: Active » Needs review

Issue #3241249: PHP Fatal error: Class Drupal\simple_oauth\Authentication\TokenAuthUser contains 1 abstract method
bradjones1’s picture

bradjones1’s picture

Status: Needs review » Closed (outdated)

I believe this was cleaned up recently; please validate on 5.2.0.

wilco’s picture

Version: 5.x-dev » 5.2.0
Priority: Major » Critical
Status: Closed (outdated) » Patch (to be ported)
StatusFileSize
new634 bytes

This fix has problems with it. The method setIsDefaultTranslation() should not cast for a boolean nor default to NULL as this is NOT the way $is_default_translation is cast. So, PHP is throwing errors.

This patch attempts to repair this issue. BTW, this is against 5.2.0 of the module.

bojan_dev’s picture

Title: PHP Fatal error: Class Drupal\simple_oauth\Authentication\TokenAuthUser contains 1 abstract method » [PP-1] PHP Fatal error: Class Drupal\simple_oauth\Authentication\TokenAuthUser contains 1 abstract method
Priority: Critical » Normal
Status: Patch (to be ported) » Postponed

The method 'setIsDefaultTranslation' is only available with a patch from: #2810355: $entity->isDefaultTranslation() behaves incorrectly when changing default translation, causing file/image field usage to be set to zero, causing files to be deleted.
The core issue still needs work, postponing it for now.