Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
\Drupal\Core\Flood\MemoryBackend::isAllowed() does not work if no event registrations happened before:
$memory_flood->isAllowed('user.failed_login_ip', 50, 3600); // Exception: 'Undefined index: user.failed_login_ip'
Comment | File | Size | Author |
---|---|---|---|
#11 | 2909952-9.patch | 2.1 KB | catch |
#11 | 2909952-9-test-only.patch | 1.39 KB | catch |
#9 | interdiff-2909952-8-9.txt | 565 bytes | edaa |
#9 | 2909952-9.patch | 2.1 KB | edaa |
#2 | 2909952-2-failing-test.patch | 1.39 KB | edaa |
Comments
Comment #2
edaa CreditAttribution: edaa commentedFailing test.
Comment #3
edaa CreditAttribution: edaa commentedNew patch fixed the issue.
Comment #5
edaa CreditAttribution: edaa commentedComment #6
edaa CreditAttribution: edaa commentedAdd a related issue.
Comment #7
edaa CreditAttribution: edaa commentedTake into account both the event name and user identifier.
Comment #8
edaa CreditAttribution: edaa commentedFix #7 wrong interdiff file.
Comment #9
edaa CreditAttribution: edaa commentedIt's better to return
$threshold > 0
thanTRUE
.Comment #10
dawehnerThank you @edwardaa! This fix totally makes sense for me. It is not allowed when you have a threshold of 0.
Comment #11
catchUploading a test-only patch so we can see the test fails. Otherwise looks good but including a test-only patch helps things get committed quicker.
Comment #15
catchCommitted/pushed to 8.5.x and cherry-picked to 8.4.x. Thanks!
Comment #16
dawehnerThank you catch!