Problem/Motivation

Drupal 11 compatibility fixes for flood_control

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

naveenvalecha created an issue. See original summary.

naveenvalecha’s picture

Title: Drupal 11 Compatibility » Drupal 11 compatibility fixes for flood_control
Issue summary: View changes

samit.310@gmail.com made their first commit to this issue’s fork.

samitk’s picture

Status: Active » Needs review

Hi,

We should use a new Git Branch/Tag for Drupal 10.2 and 11, As TypedConfigManagerInterface $typed_config_manager changes related to ConfigFormBase are introduced in 10.2.

Thanks
Samit K.

benstallings’s picture

Status: Needs review » Reviewed & tested by the community

I can confirm that this installs in Drupal 11 and can be enabled.

grevil’s picture

Status: Reviewed & tested by the community » Needs work

@samit.310@gmail.com

We should use a new Git Branch/Tag for Drupal 10.2 and 11, As TypedConfigManagerInterface $typed_config_manager changes related to ConfigFormBase are introduced in 10.2.

I guess, we could simply make it nullable and therefore provide backwards compatibility with D9?

grevil’s picture

Status: Needs work » Reviewed & tested by the community

RTBC +1!

As I said, we could make TypedConfigManagerInterface nullable and inject NULL if "config.typed" doesn't exist, but Simply dropping the D9 support is fine with me, as it has reached its EOL anyway!

web-beest’s picture

Works for me :-)
RTBC +1

ptmkenny made their first commit to this issue’s fork.

ptmkenny’s picture

I added OPT_IN_TEST_NEXT_MAJOR: '1' so that the tests are actually run against Drupal 11. Tests were all green on Drupal 10, but let's make sure they are also green on 11.

ptmkenny’s picture

Status: Reviewed & tested by the community » Needs work

Looks like the tests are failing on Drupal 11:

There were 5 errors:
1) Drupal\Tests\flood_control\Functional\FloodControlUiPageTest::testAccessAdmin
Symfony\Component\HttpFoundation\Exception\SessionNotFoundException: There is currently no session available.
/builds/issue/flood_control-3454910/vendor/symfony/http-foundation/RequestStack.php:105
/builds/issue/flood_control-3454910/web/core/tests/Drupal/Tests/BrowserTestBase.php:440
2) Drupal\Tests\flood_control\Functional\FloodControlUiPageTest::testAccessAdministerFloodUnblockPermission
Symfony\Component\HttpFoundation\Exception\SessionNotFoundException: There is currently no session available.
/builds/issue/flood_control-3454910/vendor/symfony/http-foundation/RequestStack.php:105
/builds/issue/flood_control-3454910/web/core/tests/Drupal/Tests/BrowserTestBase.php:440
3) Drupal\Tests\flood_control\Functional\FloodControlUiPageTest::testAccessFloodUnblockIpsPermission
Symfony\Component\HttpFoundation\Exception\SessionNotFoundException: There is currently no session available.
/builds/issue/flood_control-3454910/vendor/symfony/http-foundation/RequestStack.php:105
/builds/issue/flood_control-3454910/web/core/tests/Drupal/Tests/BrowserTestBase.php:440
4) Drupal\Tests\flood_control\Functional\FloodControlUiPageTest::testAccessNoPermission
Symfony\Component\HttpFoundation\Exception\SessionNotFoundException: There is currently no session available.
/builds/issue/flood_control-3454910/vendor/symfony/http-foundation/RequestStack.php:105
/builds/issue/flood_control-3454910/web/core/tests/Drupal/Tests/BrowserTestBase.php:440
5) Drupal\Tests\flood_control\Functional\FloodControlUiPageTest::testAccessAnonymous
Symfony\Component\HttpFoundation\Exception\SessionNotFoundException: There is currently no session available.
/builds/issue/flood_control-3454910/vendor/symfony/http-foundation/RequestStack.php:105
/builds/issue/flood_control-3454910/web/core/tests/Drupal/Tests/BrowserTestBase.php:440
ERRORS!
Tests: 11, Assertions: 159, Errors: 5.

Setting to "Needs work."

ptmkenny’s picture

The failing tests may be caused by this CR: https://www.drupal.org/node/3337193.

FloodControlUiPageTest.php

  /**
   * Create required user and other objects in order to run tests.
   */
  protected function setUp(): void {
    parent::setUp();

    $this->adminUser = $this->drupalCreateUser([]);
    $this->adminUser->addRole($this->createAdminRole('admin', 'admin'));
    $this->adminUser->save();

    $this->settingsUser = $this->drupalCreateUser(['administer flood unblock']);
    $this->floodUnblockUser = $this->drupalCreateUser(['flood unblock ips']);
    $this->simpleUser = $this->drupalCreateUser([]);

    // Flood backends need a request object. Create a dummy one and insert it
    // to the container.
    $request = Request::createFromGlobals();
    $this->container->get('request_stack')->push($request);

There's no session being added here.

ptmkenny’s picture

Status: Needs work » Needs review

Ok, tests are now passing on Drupal 11, so I'm setting this back to "Needs review".

batigolix’s picture

batigolix’s picture

batigolix’s picture

Status: Needs review » Reviewed & tested by the community
batigolix’s picture

Status: Reviewed & tested by the community » Fixed
batigolix’s picture

I merged this into a new 3.0.x branch for further D10 and D11 development.

The 2.3.x will not be updated and stay available for D9 for a while.

ptmkenny’s picture

Version: 2.3.x-dev » 3.0.0

Thanks! Updating the version so that anyone looking at the issue will be directed to the correct branch.

Status: Fixed » Closed (fixed)

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