Automated Drupal 10 compatibility fixes

Created on 16 June 2022, about 2 years ago
Updated 14 May 2024, about 1 month 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

RTBC

Version

4.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.
  • @jonnyhocks opened merge request.
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom jonnyhocks

    Created a fork and opened a merge request containing all the patches above.

  • Status changed to Needs work about 1 year ago
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom nicrodgers Monmouthshire, UK

    Currently unable to use the module on D10. With the MR applied, any attempt to use the CMS such as drush updb or logging in to /admin results in this fatal error:

    In Container.php line 237:

    The "current_user" service or alias has been removed or inlined when the co
    ntainer was compiled. You should either make it public, or stop using the c
    ontainer directly and use dependency injection instead.

    Disabling restrict_by_ip causes the error to go away.

  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia darvanen Sydney, Australia

    Hm, it appears to be the way they have renamed the 'current_user' service and injected it back in to their implementation of it, rather than extending the core class and overriding it.

  • Status changed to Needs review about 1 year ago
  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia darvanen Sydney, Australia

    Having trouble running tests locally because the internet here isn't great so I've pushed my work without running them.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia dineshkumarbollu

    Hi
    I Tested MR!5 using upgrade status module for D10 compatible found errors.

    vendor/bin/drush upgrade_status:analyze restrict_by_ip
    Failed to log error: Error: Class "Drupal\restrict_by_ip\Session\AccountProxy" not found in Drupal\Component\DependencyInjection\Container->createService() (line 259 of /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php). #0 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService()
    #1 /var/www/html/vbd9/web/core/lib/Drupal/Core/Logger/LoggerChannelFactory.php(41): Drupal\Component\DependencyInjection\Container->get()
    #2 [internal function]: Drupal\Core\Logger\LoggerChannelFactory->get()
    #3 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(255): call_user_func_array()
    #4 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService()
    #5 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(434): Drupal\Component\DependencyInjection\Container->get()
    #6 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters()
    #7 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService()
    #8 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(434): Drupal\Component\DependencyInjection\Container->get()
    #9 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters()
    #10 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService()
    #11 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(434): Drupal\Component\DependencyInjection\Container->get()
    #12 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters()
    #13 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService()
    #14 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(434): Drupal\Component\DependencyInjection\Container->get()
    #15 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters()
    #16 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService()
    #17 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(434): Drupal\Component\DependencyInjection\Container->get()
    #18 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters()
    #19 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService()
    #20 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(434): Drupal\Component\DependencyInjection\Container->get()
    #21 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(273): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters()
    #22 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService()
    #23 /var/www/html/vbd9/vendor/drush/drush/src/Boot/DrupalBoot8.php(288): Drupal\Component\DependencyInjection\Container->get()
    #24 /var/www/html/vbd9/vendor/drush/drush/src/Boot/DrupalBoot8.php(251): Drush\Boot\DrupalBoot8->addDrupalModuleDrushCommands()
    #25 /var/www/html/vbd9/vendor/drush/drush/src/Boot/BootstrapManager.php(291): Drush\Boot\DrupalBoot8->bootstrapDrupalFull()
    #26 /var/www/html/vbd9/vendor/drush/drush/src/Boot/BootstrapManager.php(477): Drush\Boot\BootstrapManager->doBootstrap()
    #27 /var/www/html/vbd9/vendor/drush/drush/src/Application.php(223): Drush\Boot\BootstrapManager->bootstrapMax()
    #28 /var/www/html/vbd9/vendor/drush/drush/src/Application.php(189): Drush\Application->bootstrapAndFind()
    #29 /var/www/html/vbd9/vendor/symfony/console/Application.php(237): Drush\Application->find()
    #30 /var/www/html/vbd9/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
    #31 /var/www/html/vbd9/vendor/drush/drush/src/Runtime/Runtime.php(124): Symfony\Component\Console\Application->run()
    #32 /var/www/html/vbd9/vendor/drush/drush/src/Runtime/Runtime.php(51): Drush\Runtime\Runtime->doRun()
    #33 /var/www/html/vbd9/vendor/drush/drush/drush.php(77): Drush\Runtime\Runtime->run()
    #34 /var/www/html/vbd9/vendor/drush/drush/drush(4): require('...')
    #35 /var/www/html/vbd9/vendor/bin/drush(117): include('...')
    #36 {main}
    Error: Class "Drupal\restrict_by_ip\Session\AccountProxy" not found in /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 #0 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService()
    #1 /var/www/html/vbd9/web/core/lib/Drupal/Core/Logger/LoggerChannelFactory.php(41): Drupal\Component\DependencyInjection\Container->get()
    #2 [internal function]: Drupal\Core\Logger\LoggerChannelFactory->get()
    #3 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(255): call_user_func_array()
    #4 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService()
    #5 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(434): Drupal\Component\DependencyInjection\Container->get()
    #6 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters()
    #7 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService()
    #8 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(434): Drupal\Component\DependencyInjection\Container->get()
    #9 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters()
    #10 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService()
    #11 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(434): Drupal\Component\DependencyInjection\Container->get()
    #12 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters()
    #13 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService()
    #14 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(434): Drupal\Component\DependencyInjection\Container->get()
    #15 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters()
    #16 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService()
    #17 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(434): Drupal\Component\DependencyInjection\Container->get()
    #18 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters()
    #19 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService()
    #20 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(434): Drupal\Component\DependencyInjection\Container->get()
    #21 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(273): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters()
    #22 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService()
    #23 /var/www/html/vbd9/vendor/drush/drush/src/Boot/DrupalBoot8.php(288): Drupal\Component\DependencyInjection\Container->get()
    #24 /var/www/html/vbd9/vendor/drush/drush/src/Boot/DrupalBoot8.php(251): Drush\Boot\DrupalBoot8->addDrupalModuleDrushCommands()
    #25 /var/www/html/vbd9/vendor/drush/drush/src/Boot/BootstrapManager.php(291): Drush\Boot\DrupalBoot8->bootstrapDrupalFull()
    #26 /var/www/html/vbd9/vendor/drush/drush/src/Boot/BootstrapManager.php(477): Drush\Boot\BootstrapManager->doBootstrap()
    #27 /var/www/html/vbd9/vendor/drush/drush/src/Application.php(223): Drush\Boot\BootstrapManager->bootstrapMax()
    #28 /var/www/html/vbd9/vendor/drush/drush/src/Application.php(189): Drush\Application->bootstrapAndFind()
    #29 /var/www/html/vbd9/vendor/symfony/console/Application.php(237): Drush\Application->find()
    #30 /var/www/html/vbd9/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
    #31 /var/www/html/vbd9/vendor/drush/drush/src/Runtime/Runtime.php(124): Symfony\Component\Console\Application->run()
    #32 /var/www/html/vbd9/vendor/drush/drush/src/Runtime/Runtime.php(51): Drush\Runtime\Runtime->doRun()
    #33 /var/www/html/vbd9/vendor/drush/drush/drush.php(77): Drush\Runtime\Runtime->run()
    #34 /var/www/html/vbd9/vendor/drush/drush/drush(4): require('...')
    #35 /var/www/html/vbd9/vendor/bin/drush(117): include('...')
    #36 {main}
    Error: Class "Drupal\restrict_by_ip\Session\AccountProxy" not found in Drupal\Component\DependencyInjection\Container->createService() (line 259 of /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php).
    PHP Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException: Circular reference detected for service "current_user", path: "drush.command.services -> theme.commands -> theme_installer -> asset.css.collection_optimizer -> asset.css.dumper -> file_system -> logger.channel.file -> current_user -> user_last_access_subscriber". in /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php:147
    Stack trace:
    #0 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(434): Drupal\Component\DependencyInjection\Container->get()
    #1 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters()
    #2 /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService()
    #3 /var/www/html/vbd9/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(136): Drupal\Component\DependencyInjection\Container->get()
    #4 /var/www/html/vbd9/vendor/symfony/http-kernel/HttpKernel.php(103): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
    #5 /var/www/html/vbd9/vendor/stack/builder/src/Stack/StackedHttpKernel.php(32): Symfony\Component\HttpKernel\HttpKernel->terminate()
    #6 /var/www/html/vbd9/web/core/lib/Drupal/Core/DrupalKernel.php(702): Stack\StackedHttpKernel->terminate()
    #7 /var/www/html/vbd9/vendor/drush/drush/src/Boot/DrupalBoot8.php(310): Drupal\Core\DrupalKernel->terminate()
    #8 [internal function]: Drush\Boot\DrupalBoot8->terminate()
    #9 {main}
    thrown in /var/www/html/vbd9/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 147

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia gurbakshish

    #2 patch looks good, thanks

  • Assigned to nicrodgers
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom nicrodgers Monmouthshire, UK
  • Issue was unassigned.
  • Status changed to Needs work about 1 year ago
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom nicrodgers Monmouthshire, UK

    @darvanen I've tested the MR. The errors from #9 are gone, however you are now able to log in from any IP address, it does not block you if you are not on the allowed list.

    Also I think the strlen changes in this commit https://git.drupalcode.org/project/restrict_by_ip/-/merge_requests/5/dif... should be reverted, in favor of https://www.drupal.org/project/restrict_by_ip/issues/3292104 ๐Ÿ› Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /app/docroot/modules/contrib/restrict_by_ip/src/RoleFirewall.php on line 47 RTBC which has already been RTBC'd and is more extensive.

    Thanks for your efforts in trying to get this working, hopefully we're nearly there....

  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia darvanen Sydney, Australia

    @nicrodgers yeah fair enough re ๐Ÿ› Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /app/docroot/modules/contrib/restrict_by_ip/src/RoleFirewall.php on line 47 RTBC , I just needed to see what errors were happening without the noise. We can clear those out when the MR is working.

    I also got my test suite working and found out the module isn't working properly, so I'm still working on it. What I noticed is that a user with a specific role is not able to log in at all, with no configurations set.

    I'm solo parenting this weekend so I probably won't be able to get to it for a while.

  • Status changed to Needs review about 1 year ago
  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia darvanen Sydney, Australia

    Alrighty, one thing led to another and this is a pretty big change now, you can follow the journey in the commits.

    I've removed the strlen() changes as requested. When I combined this work with the patch from ๐Ÿ› Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /app/docroot/modules/contrib/restrict_by_ip/src/RoleFirewall.php on line 47 RTBC all but two tests passed locally and the two that failed did so because the 'destination' parameter was not respected, but it looks like that was never the case and I didn't want to add that functionality in.

    Here's a combined patch to see if we can run the automated tests.

  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 10.0.7 + Environment: PHP 8.1 & MariaDB 10.3.22
    last update about 1 year ago
    45 pass, 2 fail
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 8.1 & MariaDB 10.3.22
    last update about 1 year ago
    45 pass, 2 fail
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 8.0 & MySQL 5.7
    last update about 1 year ago
    45 pass, 2 fail
  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia darvanen Sydney, Australia

    I consider that to be a good result. The two expected failures are the only ones present and it still works with Drupal 9 and PHP 8.0.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom nicrodgers Monmouthshire, UK

    @daraven thanks for all your work on this.

    how are you testing this locally?
    I can't use the combined patch in #17 because composer complains that drupal/restrict_by_ip dev-4.x requires drupal/core ^8 || ^9 - but if I use the MR then the latest patch in #3292104 no longer applies.

  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia darvanen Sydney, Australia

    Locally:

    • I have a clean Drupal 10 install (using ddev and these instructions for getting testing going).
    • Then I git clone the module
    • Pull the MR branch
    • Apply the patch at the module's root with curl https://www.drupal.org/files/issues/2023-02-06/restrict_by_ip-3292104-5.patch | patch.-p1

    Yes a couple of the hunks don't resolve but that's because I cleared out some of the dead wood that was getting quite confusing.

    You could achieve the same thing with the same first two steps then apply the patch I uploaded for testing directly to 8.x-4.x

  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia darvanen Sydney, Australia

    Oh and there's another alternative to shush that pesky "requires drupal/core ^8 || ^9:

    https://github.com/mglaman/composer-drupal-lenient

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom nicrodgers Monmouthshire, UK

    Thanks @daraven - I'm on holiday/vacation for the next two days, but if this still needs review when I'm back to work I'll get the team to test it out.

  • Status changed to Needs work about 1 year ago
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom nicrodgers Monmouthshire, UK

    Well the good news is that the latest MR does work with D10, excellent work! I've tested logging in from a trusted and untrusted IP and it works as expected.

    I've added a couple of minor comments to the MR for code improvements, and also suggested we drop D8 support whilst we're here.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia kbk1992 Hyderabad

    bharath-kondeti โ†’ made their first commit to this issueโ€™s fork.

  • Status changed to Needs review about 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia kbk1992 Hyderabad
  • Status changed to Needs work about 1 year ago
  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia darvanen Sydney, Australia

    Thanks @bharath_knodeti, there are a couple of issues with the DI implementation to clear up.

  • Status changed to Needs review about 1 year ago
  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia darvanen Sydney, Australia

    I had some time so I fixed the DI implementation. Tests pass locally except for the two regarding the destination parameter (fixing that would be scope creep):

  • 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 โ†’ this patch makes this module compatible with Drupal 10! ๐ŸŽ‰
    Therefore this patch updates 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 #12554

    This patch was created using these packages:

    1. mglaman/phpstan-drupal: 1.1.35
    2. palantirnet/drupal-rector: 0.15.1
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States patrickfweston Columbus, Ohio

    I rolled the changes from the https://www.drupal.org/project/restrict_by_ip/issues/3292104โ€™ issue onto the MR for this. Additionally, this fork is a commit behind the upstream repository, so I applied that update as well.

    This patch applies cleanly to the current version of 8.x-4.x (with hash 0092bb6).

    Testing the functionality locally is working as expected for me.

  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 8.1 & MariaDB 10.3.22
    last update 8 months ago
    45 pass, 2 fail
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States DrupalBDGirl

    Following

  • Status changed to Needs work 8 months ago
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada LeDucDuBleuet Chicoutimi QC

    I tested the patch in comment #29 using Drupal's Lenient Composer Endpoint โ†’ and it applied cleanly but it does not work as expected in D10.

    First I tested without "Global Restrictions" using only an IP restriction for a user. When logging in from an IP that is not allowed, the user can log in and seems logged in at first but we get an access denied when visiting any site url. We do not get redirected to the configured "Login denied error page". And in the recent log messages, we see "Session opened for Employe.Bidon." followed by "Login denied from 185.213.80.89 for Employe.Bidon." so the log in was effectively denied but allowed first.

    When using "Global Restrictions", the user cannot login from a global IP that is not allowed and we do not get redirected to the configured "Login denied error page" as well. And in the recent log messages, we see "Session opened for Employe.Bidon." followed by "Login denied from 185.213.80.89 for Employe.Bidon." so the log in was effectively denied but allowed first.

    When using "Global Restrictions", the user can login from an allowed global IP even though that IP is not allowed in that user's IP restriction.

    So we are getting there but there is still some work to be done...

    We really need this module to be functional in D10 so let me know when there is a new patch to test!

    I am bumping this issue as major since the Drupal 9 EOL deadline is coming up soon!

    Thanks for a great module!

  • Status changed to Needs review 8 months ago
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada LeDucDuBleuet Chicoutimi QC

    I tested again and it seems the module is working properly in D10 with the patch in comment #29.

    I am truly sorry, it seems there was something wrong with a cache on my server that was preventing the log out and the redirection...

    So I am placing back this issue to needs review, it would be great if someone else would test this as well.

    Thanks!

  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 8.1 & MariaDB 10.3.22
    last update 6 months ago
    45 pass, 2 fail
  • Status changed to RTBC 6 months ago
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada LeDucDuBleuet Chicoutimi QC

    Been using patch in comment #29 on current dev version for about 2 months now in a couple projects and it is working well with D10.2.x.

    So I am placing this to RTBC in the hopes of having an official D10 release soon.

    Thank you for a great module!

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States rex.barkdoll

    Hi all,
    I was able to install into D10 using patch #29. It seems to be working well.

    The only issue I'm getting is on the Restrict login by IP > User Restrictions page
    (/admin/config/people/restrict_by_ip/login/user)

    Warning: foreach() argument must be of type array|object, null given in Drupal\restrict_by_ip\Form\UserSettingsForm->buildForm() (line 70 of modules/custom/restrict_by_ip/src/Form/UserSettingsForm.php).
    Drupal\restrict_by_ip\Form\UserSettingsForm->buildForm(Array, Object)
    call_user_func_array(Array, Array) (Line: 536)
    Drupal\Core\Form\FormBuilder->retrieveForm('restrict_by_ip_user_settings', Object) (Line: 283)
    Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
    Drupal\Core\Controller\FormController->getContentResult(Object, Object)
    call_user_func_array(Array, Array) (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)
    Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
    Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
    Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 106)
    Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
    Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 50)
    Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
    Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
    

    Is there a change I can implement to fix this?

  • ๐Ÿ‡ซ๐Ÿ‡ฎFinland aleksip Finland

    Have tested #29 on Drupal 10.2.2 and can confirm that it seems to work.

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada LeDucDuBleuet Chicoutimi QC

    @maintainers

    This patch has been working for quite a while now.

    Would it be possible to have an official D10 release soon please?

    Thank you.

  • ๐Ÿ‡ซ๐Ÿ‡ฎFinland aleksip Finland

    Another request for an official D10 release, please. Preferably a stable release covered by the Drupal Security Team. Right now a casual look on the module page can give the impression that there is only a 7.x version.

    Is there a roadmap for such a release? Anything I can do to help?

Production build 0.69.0 2024