Problem/Motivation

drupal-check results on commit hash: 734ed5d241416246f54f7e7f857c97a06fc249a8

 ------ ----------------------------------------------------------------------------------
  Line   login_security.module
 ------ ----------------------------------------------------------------------------------
  125    Call to deprecated method format() of class Drupal\Component\Utility\SafeMarkup.
  125    Call to method format() of deprecated class Drupal\Component\Utility\SafeMarkup.
  214    Call to deprecated function drupal_get_messages().
  240    Call to deprecated method format() of class Drupal\Component\Utility\SafeMarkup.
  240    Call to method format() of deprecated class Drupal\Component\Utility\SafeMarkup.
  242    Call to deprecated function drupal_set_message().
  259    Call to deprecated function drupal_set_message().
  259    Call to deprecated function format_date().
  264    Call to deprecated function drupal_set_message().
  264    Call to deprecated function format_date().
  283    Call to deprecated function db_delete().
  289    Call to deprecated function db_delete().
  317    Call to deprecated function db_delete().
  333    Call to deprecated function db_insert().
  358    Call to deprecated method format() of class Drupal\Component\Utility\SafeMarkup.
  358    Call to method format() of deprecated class Drupal\Component\Utility\SafeMarkup.
  384    Call to deprecated method format() of class Drupal\Component\Utility\SafeMarkup.
  384    Call to method format() of deprecated class Drupal\Component\Utility\SafeMarkup.
  411    Call to deprecated function format_date().
  460    Call to deprecated method format() of class Drupal\Component\Utility\SafeMarkup.
  460    Call to method format() of deprecated class Drupal\Component\Utility\SafeMarkup.
  461    Call to deprecated method format() of class Drupal\Component\Utility\SafeMarkup.
  461    Call to method format() of deprecated class Drupal\Component\Utility\SafeMarkup.
  465    Call to deprecated method format() of class Drupal\Component\Utility\SafeMarkup.
  465    Call to method format() of deprecated class Drupal\Component\Utility\SafeMarkup.
  466    Call to deprecated method format() of class Drupal\Component\Utility\SafeMarkup.
  466    Call to method format() of deprecated class Drupal\Component\Utility\SafeMarkup.
 ------ ----------------------------------------------------------------------------------

 ------ ---------------------------------------------------
  Line   src/Form/LoginSecurityAdminSettings.php
 ------ ---------------------------------------------------
  241    Call to deprecated function drupal_set_message().
 ------ ---------------------------------------------------

 ------ ----------------------------------------------------------------------------------
  Line   src/Tests/LoginSecurityInterfaceTest.php
 ------ ----------------------------------------------------------------------------------
  40     Call to deprecated method format() of class Drupal\Component\Utility\SafeMarkup.
  40     Call to method format() of deprecated class Drupal\Component\Utility\SafeMarkup.
 ------ ----------------------------------------------------------------------------------

 ------ ----------------------------------------------------------------------------------
  Line   src/Tests/LoginSecuritySoftBlockTest.php
 ------ ----------------------------------------------------------------------------------
  24     Call to deprecated method format() of class Drupal\Component\Utility\SafeMarkup.
  24     Call to method format() of deprecated class Drupal\Component\Utility\SafeMarkup.
 ------ ----------------------------------------------------------------------------------

 ------ -----------------------------------------
  Line   src/Tests/LoginSecurityTestBase.php
 ------ -----------------------------------------
  22     Call to deprecated function db_query().
  23     Call to deprecated function db_query().
 ------ -----------------------------------------

 ------ ----------------------------------------------------------------------------------
  Line   src/Tests/LoginSecurityUserBlockingTest.php
 ------ ----------------------------------------------------------------------------------
  50     Call to deprecated method format() of class Drupal\Component\Utility\SafeMarkup.
  50     Call to method format() of deprecated class Drupal\Component\Utility\SafeMarkup.
  64     Call to deprecated method format() of class Drupal\Component\Utility\SafeMarkup.
  64     Call to method format() of deprecated class Drupal\Component\Utility\SafeMarkup.
  105    Call to deprecated method format() of class Drupal\Component\Utility\SafeMarkup.
  105    Call to method format() of deprecated class Drupal\Component\Utility\SafeMarkup.
  106    Call to deprecated method format() of class Drupal\Component\Utility\SafeMarkup.
  106    Call to method format() of deprecated class Drupal\Component\Utility\SafeMarkup.
  150    Call to deprecated function db_truncate().
  170    Call to deprecated method format() of class Drupal\Component\Utility\SafeMarkup.
  170    Call to method format() of deprecated class Drupal\Component\Utility\SafeMarkup.
  171    Call to deprecated method format() of class Drupal\Component\Utility\SafeMarkup.
  171    Call to method format() of deprecated class Drupal\Component\Utility\SafeMarkup.
  217    Call to deprecated method format() of class Drupal\Component\Utility\SafeMarkup.
  217    Call to deprecated method getUsername() of class Drupal\user\Entity\User.
  217    Call to method format() of deprecated class Drupal\Component\Utility\SafeMarkup.
 ------ ----------------------------------------------------------------------------------


 [ERROR] Found 50 errors

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Arrow created an issue. See original summary.

Sergiu Stici’s picture

Status: Active » Needs review
FileSize
15.35 KB

Here is the patch,please review.

DamienMcKenna’s picture

Title: Drupal 9 Deprecated Code Report » Drupal 9 Deprecated Code Report for Login Security module
Daniel Korte’s picture

nikolas.tatianenko’s picture

Hi all,
I've found 2 more deprecation issues.

FILENAME LINE ERROR
web/modules/contrib/login_security/src/Tests/LoginSecurityTestBase.php 10 Class Drupal\login_security\Tests\LoginSecurityTestBase extends deprecated class Drupal\simpletest\WebTestBase. Deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Instead, use Drupal\Tests\BrowserTestBase. See https://www.drupal.org/node/3030340. Replacement available from drupal:8.6.0.
web/modules/contrib/login_security/src/Tests/LoginSecurityTestBase.php 19 Call to method setUp() of deprecated class Drupal\simpletest\WebTestBase. Deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Instead, use Drupal\Tests\BrowserTestBase. See https://www.drupal.org/node/3030340. Replacement available from drupal:8.6.0.

========
Rector review result

24/24 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

[OK] Rector is done!

========
Drupal-check review result

8/8 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

[OK] No errors
=========
Upgrade status review result = no errors
=========
Tested at Drupal 8.8 and Drupal 9-beta3

driverok’s picture

Checked #5.

Still some issues with tests and module schema.

Updated #5 with fixes for tests and schema.

Now tests look good:
Testing modules/login_security/
......... 9 / 9 (100%)

Time: 11.92 minutes, Memory: 6.00 MB

OK (9 tests, 233 assertions)

Please check.

nikolas.tatianenko’s picture

mradcliffe’s picture

Status: Needs review » Needs work

Great work on the patch. Things look accurate. However

+++ b/src/Form/LoginSecurityAdminSettings.php
--- a/src/Tests/LoginSecurityEmailTest.php
+++ b/src/Tests/LoginSecurityEmailTest.php

+++ b/src/Tests/LoginSecurityEmailTest.php
--- a/src/Tests/LoginSecurityInterfaceTest.php
+++ b/src/Tests/LoginSecurityInterfaceTest.php

+++ b/src/Tests/LoginSecurityInterfaceTest.php
--- a/src/Tests/LoginSecuritySoftBlockTest.php
+++ b/src/Tests/LoginSecuritySoftBlockTest.php

+++ b/src/Tests/LoginSecuritySoftBlockTest.php
--- a/src/Tests/LoginSecurityTestBase.php
+++ b/src/Tests/LoginSecurityTestBase.php

+++ b/src/Tests/LoginSecurityTestBase.php
--- a/src/Tests/LoginSecurityUserBlockingTest.php
+++ b/src/Tests/LoginSecurityUserBlockingTest.php

Functional tests extending BrowserTestBase should be moved underneath the tests/src/Functional directory per PHPUNit file structure, namespace and required metadata.

So the directory and the namespace in the files need to be updated.

lhridley’s picture

Rerolled patch after moving tests to appropriate directory and adjusting namespacing.

Also reran for coding standards and made the latest corrections, included in this patch.

Interdiff is attached also.

lhridley’s picture

Status: Needs work » Needs review
minakshiPh’s picture

Status: Needs review » Needs work

Hi @Ihridley,

I have tested the patch in #9 and it shows following error while applying on the local; so marking to needs work.

drupal-8.8.8/modules/contrib/login_security (8.x-1.x) $ git apply --check 3042720-9_0.patch
error: tests/src/Functional/LoginSecurityEmailTest.php: already exists in working directory
error: tests/src/Functional/LoginSecurityInterfaceTest.php: already exists in working directory
error: tests/src/Functional/LoginSecuritySoftBlockTest.php: already exists in working directory
error: tests/src/Functional/LoginSecurityTestBase.php: already exists in working directory
error: tests/src/Functional/LoginSecurityUserBlockingTest.php: already exists in working directory

drupal-8.8.8/modules/contrib/login_security (8.x-1.x) $ git apply -v 3042720-9_0.patch
Checking patch config/schema/login_security.schema.yml...
Checking patch login_security.info.yml...
Checking patch login_security.module...
Checking patch src/Form/LoginSecurityAdminSettings.php...
Checking patch src/Tests/LoginSecurityEmailTest.php => tests/src/Functional/LoginSecurityEmailTest.php...
error: tests/src/Functional/LoginSecurityEmailTest.php: already exists in working directory
Checking patch src/Tests/LoginSecurityInterfaceTest.php => tests/src/Functional/LoginSecurityInterfaceTest.php...
error: tests/src/Functional/LoginSecurityInterfaceTest.php: already exists in working directory
Checking patch src/Tests/LoginSecuritySoftBlockTest.php => tests/src/Functional/LoginSecuritySoftBlockTest.php...
error: tests/src/Functional/LoginSecuritySoftBlockTest.php: already exists in working directory
Checking patch src/Tests/LoginSecurityTestBase.php => tests/src/Functional/LoginSecurityTestBase.php...
error: tests/src/Functional/LoginSecurityTestBase.php: already exists in working directory
Checking patch src/Tests/LoginSecurityUserBlockingTest.php => tests/src/Functional/LoginSecurityUserBlockingTest.php...
error: tests/src/Functional/LoginSecurityUserBlockingTest.php: already exists in working directory

drupal-8.8.8/modules/contrib/login_security (8.x-1.x) $
divyesh19’s picture

Status: Needs work » Reviewed & tested by the community

Patch #9 looks good and applies cleanly.
Able to install module on D8.8.7 as well as D9 after applying the patch.

orlando.thoeny’s picture

#9 works for me using Core 9.0.2 & dev 734ed5d of this module.

This patch also includes https://www.drupal.org/project/login_security/issues/3134020

satyaki_dutta’s picture

Please review the patch made on report from upgrade status module.

DamienMcKenna’s picture

@satyaki_dutta: Given there was already a patch that had reached RTBC, were there additional changes necessary?

satyaki_dutta’s picture

@DamienMckenna the previous uploaded patch had some issues so had to upload again

DamienMcKenna’s picture

Status: Reviewed & tested by the community » Needs review

Could you please describe the issues, and possibly provide an interdiff? Thank you.

Setting the status to "needs review" as the new patch needs to be reviewed.

DamienMcKenna’s picture

I set the tests to run against PHP 7.4 as the current 5.6 isn't supported by core (see #3164545).

satyaki_dutta’s picture

FileSize
5.25 KB

The issue with my previous patch was that the patch was given wrong for the files.

jcnventura’s picture

+++ b/login_security/login_security.module
@@ -211,7 +213,7 @@ function login_security_validate(array $form, FormStateInterface $form_state) {
+        \Drupal\Core\Messenger\MessengerInterface::messagesByType('error', TRUE);

@@ -237,9 +239,9 @@ function login_security_validate(array $form, FormStateInterface $form_state) {
+          MessengerInterface::addMessage($message, 'warning', TRUE);

There's something really wrong going on here... #9 is still the one to use.

jcnventura’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
23.49 KB

Re-uploading #9, and setting back the RTBC status from #12 and #13.

Disregard #14 and #16, please. I think no credit should be assigned.

Gábor Hojtsy’s picture

Great to see this tested. Login Security is one of the 9 top 200 projects on drupal.org that is not yet Drupal 9 compatible. 🤞

jribeiro’s picture

Status: Reviewed & tested by the community » Fixed

Thanks everyone, great work!

Committed and cut the first semantic versioning release 2.0.0.

jribeiro’s picture

jcnventura’s picture

Never saw #24 before. I've been installing this module on a few D9 sites, but the config used probably didn't trigger that. Now that the module can easily be installed in D9, you'll be able to uncover all the D9 incompatibilities that can't be discovered by automated tools.

Status: Fixed » Closed (fixed)

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