Automated Drupal 10 compatibility fixes

Created on 15 June 2022, about 2 years ago
Updated 7 November 2023, 8 months ago

Problem/Motivation

Hello project maintainers,

This is an automated issue to help make this module compatible with Drupal 10.

To read more about this effort by the Drupal Association, please read: The project update bot is being refreshed to support Drupal 10 readiness of contributed projects ā†’

Patches will periodically be added to this issue that remove Drupal 10 deprecated API uses. To stop further patches from being posted, change the status to anything other than Active, Needs review, Needs work or Reviewed and tested by the community. Alternatively, you can remove the "ProjectUpdateBotD10" tag from the issue to stop the bot from posting updates.

The patches will be posted by the Project Update Bot ā†’ official user account. This account will not receive any issue credit contributions for itself or any company.

Proposed resolution

You have a few options for how to use this issue:

  1. Accept automated patches until this issue is closed

    If this issue is left open (status of Active, Needs review, Needs work or Reviewed and tested by the community) and the "ProjectUpdateBotD10" tag is left on this issue, new patches will be posted periodically if new deprecation fixes are needed.

    As the Drupal Rector project improves and is able to fix more deprecated API uses, the patches posted here will cover more of the deprecated API uses in the module.

    Patches and/or merge requests posted by others are ignored by the bot, and general human interactions in the issue do not stop the bot from posting updates, so feel free to use this issue to refine bot patches. The bot will still post new patches then if there is a change in the new generated patch compared to the patch that the bot posted last. Those changes are then up to humans to integrate.

  2. Leave open but stop new automated patches.

    If you want to use this issue as a starting point to remove deprecated API uses but then don't want new automated patches, remove the "ProjectUpdateBotD10" tag from the issue and use it like any other issue (the status does not matter then). If you want to receive automated patches again, add back the "ProjectUpdateBotD10" tag.

  3. Close it and don't use it

    If the maintainers of this project don't find this issue useful, they can close this issue (any status besides Active, Needs review, Needs work and Reviewed and tested by the community) and no more automated patches will be posted here.

    If the issue is reopened, then new automated patches will be posted.

    If you are using another issue(s) to work on Drupal 10 compatibility it would be very useful to other contributors to add those issues as "Related issues" when closing this issue.

Remaining tasks

Using the patches

  1. Apply the latest patch in the comments by Project Update Bot ā†’ or human contributors that made it better.
  2. Thoroughly test the patch. These patches are automatically generated so they haven't been tested manually or automatically.
  3. Provide feedback about how the testing went. If you can improve the patch, post an updated patch here.

Providing feedback

If there are problems with one of the patches posted by the Project Update Bot ā†’ , such as it does not correctly replace a deprecation, you can file an issue in the Drupal Rector issue queue ā†’ . For other issues with the bot, for instance if the issue summary created by the bot is unclear, use the Project analysis issue queue ā†’ .

šŸ“Œ Task
Status

Fixed

Version

2.0

Component

Code

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • @realityloop opened merge request.
  • Status changed to Needs work over 1 year ago
  • šŸ‡¦šŸ‡ŗAustralia realityloop

    More work required, getting the following error when attempting to save settings form:

    Error: Non-static method SimpleSAML\Utils\HTTP::checkURLAllowed() cannot be called statically in Drupal\drupalauth4ssp\Form\SettingsForm->validateForm() (line 70 of /var/www/html/web/modules/contrib/drupalauth4ssp/src/Form/SettingsForm.php).

  • šŸ‡®šŸ‡³India kkalashnikov Ghaziabad, India
  • šŸ‡¦šŸ‡ŗAustralia realityloop

    Upgrade Status report of https://git.drupalcode.org/issue/drupalauth4ssp-3287081/-/tree/3287081-a...

    CONTRIBUTED PROJECTS
    --------------------------------------------------------------------------------
    DrupalAuth for SimpleSAMLphp
    Scanned on Wed, 02/15/2023 - 22:12.
    
    2 warnings found.
    
    web/modules/contrib/drupalauth4ssp/src/EventSubscriber/DrupalAuthForSSPSubscribe
    r.php:
    ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
    ā”‚  STATUS  ā”‚ LINE ā”‚                           MESSAGE                           ā”‚
    ā”œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¤
    ā”‚ Check    ā”‚ 54   ā”‚ Call to deprecated method stopPropagation() of class        ā”‚
    ā”‚ manually ā”‚      ā”‚ Symfony\Component\EventDispatcher\Event: since Symfony 4.3, ā”‚
    ā”‚          ā”‚      ā”‚ use "Symfony\Contracts\EventDispatcher\Event" instead       ā”‚
    ā”‚          ā”‚      ā”‚                                                             ā”‚
    ā”‚ Check    ā”‚ 64   ā”‚ Call to deprecated method stopPropagation() of class        ā”‚
    ā”‚ manually ā”‚      ā”‚ Symfony\Component\EventDispatcher\Event: since Symfony 4.3, ā”‚
    ā”‚          ā”‚      ā”‚ use "Symfony\Contracts\EventDispatcher\Event" instead       ā”‚
    ā”‚          ā”‚      ā”‚                                                             ā”‚
    ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
    
  • Status changed to Needs review over 1 year ago
  • šŸ‡§šŸ‡¬Bulgaria mirondi

    Tested on local and it seems working.

  • Status changed to Needs work about 1 year ago
  • šŸ‡ŗšŸ‡øUnited States AaronBauman Philadelphia

    D10 requires PHP8, which in turn requires drupalauth/simplesamlphp-module-drupalauth dependency be updated to ^1.9

    This means, if we want older versions of this module to continue to support D8/D9 and PHP7, we probably want this to be a new major release, aka 2.0

    see āœØ composer.json need to upgrade for support php8 Fixed

  • First commit to issue fork.
  • @shivam_tiwari opened merge request.
  • Status changed to Needs review about 1 year ago
  • šŸ‡¦šŸ‡ŗAustralia realityloop

    @shivam_tiwari you didn't need to create a new merge request for this, your MR removes the commits of all previous contributors, I have added your change to my MR with attribution to you.

    everyone.. Please review MR!6

  • šŸ‡ØšŸ‡³China guaneagler

    I have tried to install this module with Drupal 10, but I have met too many conflicts even though I used drupalauth/simplesamlphp-module-drupalauth with version 1.9.

    Did anyone install this module on Drupal 10 successfully?

  • šŸ‡¦šŸ‡ŗAustralia realityloop

    @guaneagler Add the following sections to your composer file repositories section:

        "repositories": {
            "drupalauth/simplesamlphp-module-drupalauth": {
                "type": "git",
                "url": "https://github.com/Realityloop/simplesamlphp-module-drupalauth.git"
            },
            "simplesamlphp/simplesamlphp": {
                "type": "git",
                "url": "https://github.com/Realityloop/simplesamlphp.git"
            }
        },
    

    Then use the following require command:
    composer require drupal/drupalauth4ssp:dev-3287081-automated-drupal-10 drupalauth/simplesamlphp-module-drupalauth simplesamlphp/simplesamlphp

    If you are also using drupal/simple_oauth you will get stuck on a dependency version constraint.

  • šŸ‡ØšŸ‡³China guaneagler

    Hi @realityloop,

    I have tried with the command you provided to install the drupalauth4ssp module
    composer require drupal/drupalauth4ssp:dev-3287081-automated-drupal-10
    But I got the error below, it seems like composer can't find the branch, even though I can see it from the repository.

      Problem 1
        - Root composer.json requires drupal/drupalauth4ssp dev-3287081-automated-drupal-10, found drupal/drupalauth4ssp[dev-idp_logout, dev-8.x-1.x, 2.x-dev] but it does not match the constraint.
    
  • šŸ‡ØšŸ‡³China guaneagler

    Hi @realityloop,

    I can see that you fork two repositories for the two libraries, and you change the composer info there, did you try if it works on Drupal 10?

    For the simplesamlphp/simplesamlphp, I can see from another project that the official library has the version of dev-simplesamlphp-2.1 which support the drupal 10 ( https://www.drupal.org/project/simplesamlphp_auth/issues/3380262 šŸ“Œ Support SimpleSAMLphp 2.1 release Fixed ). Do you think that we can use that version?

  • šŸ‡ØšŸ‡³China guaneagler

    For #18, just found that the branch is on the issue repository https://git.drupalcode.org/issue/drupalauth4ssp-3287081.git, not the module repository. I know why it doesn't work now.

  • Status changed to Needs work 11 months ago
  • šŸ‡®šŸ‡³India keshav.k

    I have tested MR !6, There are still few issues.
    Attaching screen shot.

  • šŸ‡¦šŸ‡ŗAustralia realityloop

    @guaneagler yes I am using it on a D10 project that's in development

  • Status changed to Needs review 9 months ago
  • šŸ‡ŗšŸ‡øUnited States AaronBauman Philadelphia

    @keshav the error you describe may be due to you using an older version of Drupal or symfony.
    On Drupal 10.1.4 and symfony 6.3, the Symfony\Component\HttpKernel\Event\ResponseEvent implements Symfony\Contracts\EventDispatcher\StoppableEventInterface

    @realityloop 2 things:

    1. are you planning to take on maintenance of simplesamlphp-module-drupalauth ?
    I see your PR, and looks like the upstream project has gone stagnant...

    2. your suggested composer config works for me to get the packages set up (haven't actually been able to test the SSO yet though), here's a slightly more minimal version:

        "repositories": {
            "drupal": {
                "type": "composer",
                "url": "https://packages.drupal.org/8",
                "exclude": [
                    "drupal/drupalauth4ssp"
                ]
            },
            "drupal/drupalauth4ssp": {
                "type": "git",
                "url": "https://git.drupalcode.org/issue/drupalauth4ssp-3287081.git"
            },
            "drupalauth/simplesamlphp-module-drupalauth": {
                "type": "git",
                "url": "https://github.com/Realityloop/simplesamlphp-module-drupalauth.git"
            }
        },
    
    "require": {
            "drupal/drupalauth4ssp": "dev-3287081-automated-drupal-10",
            "drupalauth/simplesamlphp-module-drupalauth": "^1.9@dev",
            "simplesamlphp/simplesamlphp": "dev-simplesamlphp-2.1",
    
  • šŸ‡ŗšŸ‡øUnited States AaronBauman Philadelphia

    OK, finally got my config updated and usable, and able to review the functionality.

    Cross-posting from drupalauth github:
    I'm getting an error when testing in version simplesamlphp/simplesamlphp:dev-simplesamlphp-2.1

    Caused by: Exception: Could not resolve 'drupalauth:External': The class 'SimpleSAML\Module\drupalauth\Auth\Source\External' isn't a subclass of '\SimpleSAML\Auth\Source'.
    

    Which is weird, because SimpleSAML\Module\drupalauth\Auth\Source\External is definitely a subclass of SimpleSAML\Auth\Source

    stack trace:

    SimpleSAML\Error\Error: UNHANDLEDEXCEPTION
    Backtrace:
    2 public/_include.php:28 (SimpleSAML_exception_handler)
    1 vendor/symfony/error-handler/ErrorHandler.php:537 (Symfony\Component\ErrorHandler\ErrorHandler::handleException)
    0 [builtin] (N/A)
    Caused by: Exception: Could not resolve 'drupalauth:External': The class 'SimpleSAML\Module\drupalauth\Auth\Source\External' isn't a subclass of '\SimpleSAML\Auth\Source'.
    Backtrace:
    8 src/SimpleSAML/Module.php:459 (SimpleSAML\Module::resolveClass)
    7 src/SimpleSAML/Auth/Source.php:313 (SimpleSAML\Auth\Source::parseAuthSource)
    6 src/SimpleSAML/Auth/Source.php:356 (SimpleSAML\Auth\Source::getById)
    5 src/SimpleSAML/Auth/Simple.php:62 (SimpleSAML\Auth\Simple::getAuthSource)
    4 src/SimpleSAML/Auth/Simple.php:151 (SimpleSAML\Auth\Simple::login)
    3 [builtin] (call_user_func_array)
    2 src/SimpleSAML/HTTP/RunnableResponse.php:68 (SimpleSAML\HTTP\RunnableResponse::sendContent)
    1 vendor/symfony/http-foundation/Response.php:423 (Symfony\Component\HttpFoundation\Response::send)
    0 public/module.php:24 (N/A)
                
  • šŸ‡ŗšŸ‡øUnited States AaronBauman Philadelphia

    Update - in the drupalauth/simplesamlphp-module-drupalauth package: renaming lib directory to src resolves this issue.

  • šŸ‡¦šŸ‡ŗAustralia realityloop

    @AaronBauman I've just merged that PR, cheers.

    We have code in our composer.json to handle the autoloading that I'd mistakenly not included in my pastes above.

    I can also confirm we have working saml implementation on our build now..

  • šŸ‡ŗšŸ‡øUnited States AaronBauman Philadelphia

    Awesome, thanks!
    I've got my D10 IDP up and running, but still don't have an SP to actually test SSO.
    Will report back when I get that going

  • Status changed to Fixed 8 months ago
  • šŸ‡³šŸ‡æNew Zealand RoSk0 Wellington

    Drupal 10 compatible version 2.0.0-rc1 was just released.

    Please test and report back any issues.

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

Production build 0.69.0 2024