- Merge request !7Issue #3288840: Automated Drupal 10 compatibility fixes โ (Merged) created by voleger
- Status changed to Needs work
almost 2 years ago 10:55am 10 June 2023 - ๐น๐ทTurkey orkut murat yฤฑlmaz Istanbul
Hello all,
Thank you @voleger for your contribution.
I've downloaded the @voleger's commit on 'merge request !7' as a patch and tried to apply, but unfortunately it has failed with the error log below:
$ patch -p1 < 7.patch patching file oauth2_server.api.php patching file oauth2_server.info.yml patching file oauth2_server.services.yml patching file src/Authentication/Provider/OAuth2DrupalAuthProvider.php patching file src/Form/AuthorizeForm.php patching file src/OAuth2Storage.php patching file src/ScopeUtility.php patching file src/Utility.php patching file tests/src/Functional/OAuth2ServerAdminTest.php patching file tests/src/Functional/OAuth2ServerStorageTest.php patching file tests/src/Functional/OAuth2ServerTest.php patching file src/OAuth2Helper.php Hunk #1 FAILED at 37. Hunk #2 FAILED at 45. 2 out of 2 hunks FAILED -- saving rejects to file src/OAuth2Helper.php.rej
What could be the reason of fails?
Best,
Orkut - Status changed to Needs review
almost 2 years ago 8:22am 24 June 2023 - Open on Drupal.org โCore: 9.5.x + Environment: PHP 7.4 & MySQL 8last update
almost 2 years ago Waiting for branch to pass This is an automated patch generated by Drupal Rector. Please see the issue summary for more details.
It is important that any automated tests available are run with this patch and that you manually test this patch.
Drupal 10 Compatibility
According to the Upgrade Status module โ , even with this patch, this module is not yet compatible with Drupal 10.
Currently Drupal Rector, version 0.15.1, cannot fix all Drupal 10 compatibility problems.
Therefore this patch does not update the
info.yml
file for Drupal 10 compatibility.Leaving this issue open, even after committing the current patch, will allow the Project Update Bot โ to post additional Drupal 10 compatibility fixes as they become available in Drupal Rector.
Debug info
Bot run #12554This patch was created using these packages:
- mglaman/phpstan-drupal: 1.1.35
- palantirnet/drupal-rector: 0.15.1
- Status changed to Needs work
almost 2 years ago 10:13am 27 June 2023 - ๐น๐ทTurkey orkut murat yฤฑlmaz Istanbul
I've applied the patch #11 and received the logs I paste below:
$ patch -p1 < oauth2_server.2.0.x-dev.rector.patch patching file oauth2_server.api.php Hunk #2 FAILED at 28. Hunk #3 FAILED at 49. 2 out of 3 hunks FAILED -- saving rejects to file oauth2_server.api.php.rej patching file src/Authentication/Provider/OAuth2DrupalAuthProvider.php Hunk #1 succeeded at 2 with fuzz 1. Hunk #2 succeeded at 215 (offset 32 lines). patching file src/Form/AuthorizeForm.php Hunk #1 FAILED at 118. 1 out of 1 hunk FAILED -- saving rejects to file src/Form/AuthorizeForm.php.rej patching file src/OAuth2Storage.php Hunk #1 succeeded at 1011 (offset -11 lines). patching file src/Utility.php patching file tests/src/Functional/OAuth2ServerAdminTest.php Hunk #4 succeeded at 60 (offset 1 line). Hunk #5 succeeded at 72 with fuzz 2 (offset 1 line). Hunk #6 succeeded at 106 (offset 10 lines). patching file tests/src/Functional/OAuth2ServerStorageTest.php patching file tests/src/Functional/OAuth2ServerTest.php
After that, I've checked the upgrade status page and it looks uncompatible, locally.
I'm changing the issue status as Needs Work.
Best,
Orkut - Status changed to Needs review
over 1 year ago 6:49am 14 August 2023 - ๐ฆ๐บAustralia cafuego
The patch from #11 seems to apply just fine to the 2.0.x branch. Whether it makes the module work with D10 is another issue :-)
- Status changed to Needs work
over 1 year ago 3:30pm 5 September 2023 - ๐จ๐ฆCanada porchlight
After applying the changes in the current merge request I'm getting an error when I run cron. Need to add `$query->accessCheck(TRUE);` to the hook_cron function in the .module. I would do it but I don't know how to add to the MR.
- Open on Drupal.org โCore: 9.5.x + Environment: PHP 7.4 & MySQL 8last update
over 1 year ago Waiting for branch to pass - ๐ฉ๐ชGermany dernetzjaeger Rostock
I scanned the latest dev version plus the patch from #11 applied with the upgrade status module and found 6 D10 incompatibility issues.
I fixed these issues in my patch and rescanned it with no further open issues.
I also tested this version in my test installation with a Drupal instance running oauth2_server Module and another Drupal instance running openid_connect Module.
The whole process worked properly and I was able to log in,
- last update
over 1 year ago 6 fail - ๐ฉ๐ชGermany dernetzjaeger Rostock
After running the Upgrade from D9 to D10 I ran into the following message when running
drush updb
:Unable to decode output into JSON: Syntax error Fatal error: Declaration of Drupal\oauth2_server\OAuth2Storage::setAuthorizationCode($code, $client_id, $uid, $redirect_uri, $expires, $scope = null, $id_token = null) must be compatible with OAuth2\OpenID\Storage\AuthorizationCodeInterface::setAuthor izationCode($code, $client_id, $user_id, $redirect_uri, $expires, $scope = null, $id_token = null, $code_challenge = null, $code_challenge_method = null) in /app/web/modules/contrib/oauth2_server/src/OAuth2Storage.php on line 536
The new patch resolves this issue.
- last update
over 1 year ago Composer require failure - last update
over 1 year ago Composer require failure - ๐ฎ๐ณIndia sahal_va
Hi @dernetzjaeger
This might help https://www.drupal.org/project/oauth2_server/issues/3366668 ๐ module stopped working after library upgrade RTBC
- last update
over 1 year ago Composer require failure - ๐บ๐ธUnited States hyperlinked San Jose, CA
Patch #16 isn't completely working for me on 10.1.5. When I clear the cache I get the following error:
Interface "OAuth2\OpenID\Storage\AuthorizationCodeInterface" not found
- Status changed to Needs review
over 1 year ago 2:25pm 14 October 2023 - ๐บ๐ธUnited States hyperlinked San Jose, CA
Nevermind, #16 works. I didn't have the two required vendor packages installed. After requiring bshaffer/oauth2-server-php and bshaffer/oauth2-server-httpfoundation-bridge, #16 is working. I haven't been able to confirm that I'm able to login yet as I'm having some other unrelated issues with the login process.
- Status changed to RTBC
over 1 year ago 1:33pm 15 October 2023 - ๐บ๐ธUnited States hyperlinked San Jose, CA
I've resolved the unrelated issues that were blocking me from successfully completing a remote site authorization and I can now confirm that patch #16 is working for me and resolves all of my issues. I'm using the authorization code grant with refresh tokens.
- ๐บ๐ฆUkraine v.koval
Hi, community!
The patch in #16 does not work for users using version 2.0.0-beta4. 2.0.0-beta4 This is the tag, and the patch is applied to the development branch - Open in Jenkins โ Open on Drupal.org โCore: 10.1.x + Environment: PHP 8.2 & MySQL 8 (--ignore-platfrom-reqs)last update
over 1 year ago Composer require failure - ๐น๐ทTurkey orkut murat yฤฑlmaz Istanbul
@v.koval, the patch #16 is for the version 2.0.x-dev, as seen on issue metadata. After merge and deployment process is done, it will be working for other versions as well.
- ๐ฆ๐บAustralia cafuego
I have a set of patches that works for 2.0.0-beta4 (which I use because part of the refactor of 2.0.x-dev has broken a thing I need) with Drupal 10 and PHP 8.2:
- The MR from comment 9
- The MR from comment 14
- The patch from issue #3366668
- https://www.drupal.org/files/issues/2023-10-27/oauth2_server.d10.patch โ
- Open on Drupal.org โCore: 9.5.x + Environment: PHP 7.4 & MySQL 8last update
over 1 year ago Waiting for branch to pass - ๐บ๐ฆUkraine v.koval
@cafuego Thanks!
But, this patch doesn't work, because in the module are a lot of deprecation functions. I created a new patch, it works for me - last update
over 1 year ago Patch Failed to Apply - Open on Drupal.org โCore: 9.5.x + Environment: PHP 7.4 & MySQL 8last update
over 1 year ago Waiting for branch to pass - last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago Composer require failure - Open on Drupal.org โCore: 9.5.x + Environment: PHP 7.4 & MySQL 8last update
over 1 year ago Waiting for branch to pass - ๐ณ๐ฑNetherlands robertragas
Hello Koval,
For me also your patch does not work on Drupal 10 with 2.0.0-beta4 due to the setAuthorizationCode compatibility that #16 refers to.
Attached the patch based on #25 but with the setAuthorizationCode compatibility from #16.Would be good though if we can get that dev version with #16 released to a new version to avoid divergent patches like we have now.
- ๐ฆ๐บAustralia cafuego
@v.koval For the record, my patch only works on the beta if you also apply the other patches I listed in the comment.
patch #26 doesnt work.
+ foreach (\Drupal::moduleHandler()->invokeAllWith('oauth2_server_default_scope') as $module)
This code introduce an error
Too few arguments to function Drupal\Core\Extension\ModuleHandler::invokeAllWith(),
because this method expected 2 arguments.
- First commit to issue fork.
- Open on Drupal.org โCore: 9.5.x + Environment: PHP 7.4 & MySQL 8last update
over 1 year ago Waiting for branch to pass - Open on Drupal.org โCore: 9.5.x + Environment: PHP 7.4 & MySQL 8last update
over 1 year ago Waiting for branch to pass - Open on Drupal.org โCore: 9.5.x + Environment: PHP 7.4 & MySQL 8last update
over 1 year ago Waiting for branch to pass - Open on Drupal.org โCore: 9.5.x + Environment: PHP 7.4 & MySQL 8last update
over 1 year ago Waiting for branch to pass - Open on Drupal.org โCore: 9.5.x + Environment: PHP 7.4 & MySQL 8last update
over 1 year ago Waiting for branch to pass - Open on Drupal.org โCore: 9.5.x + Environment: PHP 7.4 & MySQL 8last update
over 1 year ago Waiting for branch to pass - Open on Drupal.org โCore: 9.5.x + Environment: PHP 7.4 & MySQL 8last update
over 1 year ago Waiting for branch to pass - Open on Drupal.org โCore: 9.5.x + Environment: PHP 7.4 & MySQL 8last update
over 1 year ago Waiting for branch to pass - ๐ฌ๐งUnited Kingdom somersoft
Please review again.
As the oauth2_server.info.yml file needs updating so that it runs with Drupal 10 Framework a fork was made of the code base and updated to be Drupal 10 compatible.
The #26 patch has been added to this code base and also a fix for #28 comment.
The default CI pipeline template has been added and all the tests pass.Example entry for composer.json
"repositories": { "oauth2_server": { "type": "package", "package": { "name": "drupal/oauth2_server", "version": "dev-custom", "type": "drupal-module", "source": { "url": "https://git.drupalcode.org/issue/oauth2_server-3288840", "type": "git", "reference": "8ed68d27336dcbea0041b0c5e25f92888c6e3ac1" } } } } "require": { "drupal/oauth2_server": "dev-custom" }
- last update
over 1 year ago Patch Failed to Apply - last update
about 1 year ago 22 pass - ๐ซ๐ทFrance GaรซlG Lille, France
GaรซlG โ made their first commit to this issueโs fork.
- last update
about 1 year ago 22 pass - last update
about 1 year ago 22 pass -
cafuego โ
committed 3b88b67a on 2.0.x authored by
voleger โ
Issue #3288840: Automated Drupal 10 compatibility fixes
-
cafuego โ
committed 3b88b67a on 2.0.x authored by
voleger โ
- Status changed to Fixed
about 1 year ago 5:24am 7 March 2024 Automatically closed - issue fixed for 2 weeks with no activity.