When attempting to make an API request and authenticating by supplying a bearer token, an exception will be thrown:
Fatal error</b>: Class Drupal\simple_oauth\Authentication\TokenAuthUser contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (Drupal\Core\Entity\RevisionableInterface::getLatestRevisionId, Drupal\Core\Entity\RevisionableInterface::isLatestRevision) in <b>/var/www/drupalvm/docroot/modules/contrib/simple_oauth/src/Authentication/TokenAuthUser.php on line 16
I have created a patch which includes the two methods that are required to meet the interface's requirements.
This fault has been reported before* but seems to have only been applied to 8.x-2.x
* https://www.drupal.org/project/simple_oauth/issues/2839585
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | 2941522--interdiff--10-11.txt | 3.17 KB | e0ipso |
| #11 | 2941522--implement-revisionable-interface--11.patch | 1.28 KB | e0ipso |
Comments
Comment #2
damodamodamo commentedComment #3
e0ipsoThanks for your report. What version of core are you using?
Comment #4
damodamodamo commentedWe are running version 8.4.0
Comment #5
e0ipso@damodamodamo thanks for responding. Can you share your call?
Comment #6
damodamodamo commentedMy request looks like this:
curl -X POST http://drupal-project.api/oauth/token -d "grant_type=client_credentials&client_id=61435b1c-f023-xxxx-xxxx-xxxxxxxx&client_secret=somesecret"I have enabled both Simple Oauth and Simple OAuth Extras.
Comment #7
e0ipsoAdded a possible related issue.
Comment #8
e0ipsoYou can see how 8.x-3.x contains this code: https://cgit.drupalcode.org/simple_oauth/tree/src/Authentication/TokenAu...
Can you list the version of the module you are using, via composer?
composer info drupal/simple_oauthComment #9
e0ipsoAlso welcome to the community @damodamodamo!!
Comment #10
raphael apard commentedI have a similar error using 3.5 and 3.x-dev :
PHP Fatal error: Class Drupal\\simple_oauth\\Authentication\\TokenAuthUser contains 6 abstract methods and must therefore be declared abstract or implement the remaining methods.I'm using Drupal 8.5 wit PHP 7.1.7.
composer info drupal/simple_oauth :
Here a patch working for me.
Comment #11
e0ipsoThanks for the patch @Raphael Apard!
I made some minor changes to it, let's see if it passes the tests.
Comment #12
e0ipsoComment #13
vb commentedPlease implement getLatestRevisionId() either, error without it
Comment #14
lawxen commentedLike https://www.drupal.org/project/simple_oauth/issues/2945431#comment-12511925 said, this issue hasn't been fixed.
Comment #16
e0ipsoThis was not pushed before.