Problem/Motivation

drupal-check report against 8.x-4.x at commit 2a4b0e4f640219bb7d0bb6622fa502e842fe5516

$ drupal-check .
79/79 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

------ --------------------------------------------------------------------------
Line   src/Entities/AccessTokenEntity.php
------ --------------------------------------------------------------------------
30     Call to deprecated method set() of class Lcobucci\JWT\Builder:
This method will be removed on v4
30     Call to deprecated method setAudience() of class Lcobucci\JWT\Builder:
This method will be removed on v4
30     Call to deprecated method setExpiration() of class Lcobucci\JWT\Builder:
This method will be removed on v4
30     Call to deprecated method setId() of class Lcobucci\JWT\Builder:
This method will be removed on v4
30     Call to deprecated method setIssuedAt() of class Lcobucci\JWT\Builder:
This method will be removed on v4
30     Call to deprecated method setNotBefore() of class Lcobucci\JWT\Builder:
This method will be removed on v4
30     Call to deprecated method setSubject() of class Lcobucci\JWT\Builder:
This method will be removed on v4
40     Call to deprecated method set() of class Lcobucci\JWT\Builder:
This method will be removed on v4
44     Call to deprecated method sign() of class Lcobucci\JWT\Builder:
This method will be removed on v4
------ --------------------------------------------------------------------------

[ERROR] Found 9 errors

Proposed resolution

Fix the deprecation notice so drupal-check comes back green

Remaining tasks

Create a patch.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

None.

Comments

anavarre created an issue. See original summary.

sephster’s picture

The deprecated functions have been patched in the OAuth2-Server. I expect to release this in the next minor version which should be in a couple of weeks tops. Hope this helps!

kristen pol’s picture

Issue tags: +Drupal 9 compatibility

Per a Slack discussion with Gábor Hojtsy regarding usage of D9 tags (Drupal 9, Drupal 9 compatibility, Drupal 9 readiness, etc.), "Drupal 9 compatibility" should be used for contributed projects that need updating and "Drupal 9" was the old tag for D8 issues before the D9 branch was ready. Doing tag cleanup here based on that discussion.

katherined’s picture

Status: Active » Needs review
StatusFileSize
new1.11 KB

This should fix the following:

 ------ -------------------------------------------------------------------------------------- 
  Line   docroot/modules/contrib/simple_oauth/tests/src/Functional/AuthCodeFunctionalTest.php  
 ------ -------------------------------------------------------------------------------------- 
  247    Call to deprecated method randomBytes() of class Drupal\Component\Utility\Crypt:      
         in drupal:8.8.0 and is removed from drupal:9.0.0.                                     
         Use PHP's built-in random_bytes() function instead. 
berdir’s picture

Status: Needs review » Needs work

That does require PHP 7, so the module either needs to require Drupal 8.8 or php7 (might be the easier option to get it committed now?

I also get this one with latest drupal-check:

 ------ ------------------------------------------------------------------------------------------------------------------------------------------------- 
  Line   src/Entity/Form/Oauth2TokenDeleteForm.php                                                                                                        
 ------ ------------------------------------------------------------------------------------------------------------------------------------------------- 
  40     Parameter $entity_manager of method Drupal\simple_oauth\Entity\Form\Oauth2TokenDeleteForm::__construct() has typehint with deprecated interface  
         Drupal\Core\Entity\EntityManagerInterface:                                                                                                       
         in drupal:8.0.0 and is removed from drupal:9.0.0.                                                                                                
 ------ ------------------------------------------------------------------------------------------------------------------------------------------------- 

Also needs the core_version_requirement key in all modules.

berdir’s picture

And, running the tests gives me these:

  18x: Drupal\Tests\BrowserTestBase::$defaultTheme is required in drupal:9.0.0 when using an install profile that does not set a default theme. See https://www.drupal.org/node/3083055, which includes recommendations on which theme to use.
    1x in PasswordFunctionalTest::testPasswordGrant from Drupal\Tests\simple_oauth\Functional
    1x in RolesNegotiationFunctionalTest::testRequestWithRoleRemovedFromClient from Drupal\Tests\simple_oauth\Functional
    1x in RolesNegotiationFunctionalTest::testRequestWithRoleRemovedFromUser from Drupal\Tests\simple_oauth\Functional
    1x in RefreshFunctionalTest::testInvalidRefreshGrant from Drupal\Tests\simple_oauth\Functional
    1x in RefreshFunctionalTest::testMissingRefreshGrant from Drupal\Tests\simple_oauth\Functional
    1x in RefreshFunctionalTest::testRefreshGrant from Drupal\Tests\simple_oauth\Functional
    1x in PasswordFunctionalTest::testInvalidPasswordGrant from Drupal\Tests\simple_oauth\Functional
    1x in PasswordFunctionalTest::testMissingPasswordGrant from Drupal\Tests\simple_oauth\Functional
    1x in ImplicitFunctionalTest::testValidClientImplicitGrant from Drupal\Tests\simple_oauth\Functional
    1x in AuthCodeFunctionalTest::testAuthCodeGrant from Drupal\Tests\simple_oauth\Functional
    1x in ImplicitFunctionalTest::testImplicitGrant from Drupal\Tests\simple_oauth\Functional
    1x in ClientCredentialsFunctionalTest::testInvalidClientCredentialsGrant from Drupal\Tests\simple_oauth\Functional
    1x in ClientCredentialsFunctionalTest::testMissingClientCredentialsGrant from Drupal\Tests\simple_oauth\Functional
    1x in ClientCredentialsFunctionalTest::testClientCredentialsGrant from Drupal\Tests\simple_oauth\Functional
    1x in AuthCodeFunctionalTest::testClientAuthCodeGrantWithPkce from Drupal\Tests\simple_oauth\Functional
    1x in AuthCodeFunctionalTest::testRememberClient from Drupal\Tests\simple_oauth\Functional
    1x in AuthCodeFunctionalTest::testNon3rdPartyClientAuthCodeGrant from Drupal\Tests\simple_oauth\Functional
    1x in RolesNegotiationFunctionalTest::testRequestWithMissingScope from Drupal\Tests\simple_oauth\Functional

  18x: Entity type "oauth2_token_type" is using config schema as a fallback for a missing `config_export` definition is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. See https://www.drupal.org/node/2949023.
    1x in PasswordFunctionalTest::testPasswordGrant from Drupal\Tests\simple_oauth\Functional
    1x in RolesNegotiationFunctionalTest::testRequestWithRoleRemovedFromClient from Drupal\Tests\simple_oauth\Functional
    1x in RolesNegotiationFunctionalTest::testRequestWithRoleRemovedFromUser from Drupal\Tests\simple_oauth\Functional
    1x in RefreshFunctionalTest::testInvalidRefreshGrant from Drupal\Tests\simple_oauth\Functional
    1x in RefreshFunctionalTest::testMissingRefreshGrant from Drupal\Tests\simple_oauth\Functional
    1x in RefreshFunctionalTest::testRefreshGrant from Drupal\Tests\simple_oauth\Functional
    1x in PasswordFunctionalTest::testInvalidPasswordGrant from Drupal\Tests\simple_oauth\Functional
    1x in PasswordFunctionalTest::testMissingPasswordGrant from Drupal\Tests\simple_oauth\Functional
    1x in ImplicitFunctionalTest::testValidClientImplicitGrant from Drupal\Tests\simple_oauth\Functional
    1x in AuthCodeFunctionalTest::testAuthCodeGrant from Drupal\Tests\simple_oauth\Functional
    1x in ImplicitFunctionalTest::testImplicitGrant from Drupal\Tests\simple_oauth\Functional
    1x in ClientCredentialsFunctionalTest::testInvalidClientCredentialsGrant from Drupal\Tests\simple_oauth\Functional
    1x in ClientCredentialsFunctionalTest::testMissingClientCredentialsGrant from Drupal\Tests\simple_oauth\Functional
    1x in ClientCredentialsFunctionalTest::testClientCredentialsGrant from Drupal\Tests\simple_oauth\Functional
    1x in AuthCodeFunctionalTest::testClientAuthCodeGrantWithPkce from Drupal\Tests\simple_oauth\Functional
    1x in AuthCodeFunctionalTest::testRememberClient from Drupal\Tests\simple_oauth\Functional
    1x in AuthCodeFunctionalTest::testNon3rdPartyClientAuthCodeGrant from Drupal\Tests\simple_oauth\Functional
    1x in RolesNegotiationFunctionalTest::testRequestWithMissingScope from Drupal\Tests\simple_oauth\Functional

  16x: The ::getCurrentUserId method is deprecated in 8.6.x and will be removed before 9.0.0.
    4x in AuthCodeFunctionalTest::testRememberClient from Drupal\Tests\simple_oauth\Functional
    4x in PasswordFunctionalTest::testPasswordGrant from Drupal\Tests\simple_oauth\Functional
    3x in RefreshFunctionalTest::testRefreshGrant from Drupal\Tests\simple_oauth\Functional
    1x in AuthCodeFunctionalTest::testAuthCodeGrant from Drupal\Tests\simple_oauth\Functional
    1x in AuthCodeFunctionalTest::testNon3rdPartyClientAuthCodeGrant from Drupal\Tests\simple_oauth\Functional
    1x in AuthCodeFunctionalTest::testClientAuthCodeGrantWithPkce from Drupal\Tests\simple_oauth\Functional
    1x in RefreshFunctionalTest::testMissingRefreshGrant from Drupal\Tests\simple_oauth\Functional
    1x in RefreshFunctionalTest::testInvalidRefreshGrant from Drupal\Tests\simple_oauth\Functional

  1x: Drupal\Component\Utility\Crypt::randomBytes() is deprecated in Drupal 8.8.0 and will be removed before Drupal 9.0.0. Use PHP's built-in random_bytes() function instead. See https://www.drupal.org/node/3054488
    1x in AuthCodeFunctionalTest::testClientAuthCodeGrantWithPkce from Drupal\Tests\simple_oauth\Functional

The getCurrentUserId is fun, apparently this module copied over the owner definition from user and uses its default value callback. Not sure if this is a case for EntityOwnerInterface/EntityOwnerTrait, that would also require an update function. We could start with just using the trait for the default value callback?

phenaproxima’s picture

Status: Needs work » Needs review
StatusFileSize
new6.65 KB

This should fix all remaining deprecations, including the runtime test ones.

Status: Needs review » Needs work

The last submitted patch, 7: 3088546-7.patch, failed testing. View results

phenaproxima’s picture

Status: Needs work » Needs review

The test failure was a pre-existing random failure; see https://www.drupal.org/pift-ci-job/1561409. I was able to confirm this locally by running the test 30 times; it passed 29 of those times, and failed once with that same "undefined index" notice.

I think it's pretty clear that the problem is not being introduced by this patch, so back to "needs review" we go.

e0ipso’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for the patch! I did not see anything concerning, only good stuff.

Thanks for contributing phenaproxima, katherined, Berdir, anavarre, Kristen Pol, and sephster! This module is better and more useful thanks to you. Open source maintainers need contributions to keep up. ❤️

  • e0ipso committed 112ba10 on 8.x-4.x authored by phenaproxima
    Issue #3088546 by phenaproxima, katherined, anavarre, Berdir, sephster,...
e0ipso’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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