Problem/Motivation

drupal-check results on commit hash:
source : [git] https://git.drupal.org/project/r4032login a10444360f0d738e7517616fa30d60b5b1da0871
source : http://cgit.drupalcode.org/r4032login


 ------ --------------------------------------------------- 
  Line   src/EventSubscriber/R4032LoginSubscriber.php       
 ------ --------------------------------------------------- 
  169    Call to deprecated function drupal_set_message().  
 ------ --------------------------------------------------- 

 ------ ---------------------------------------------- 
  Line   tests/src/Unit/R4032LoginSubscriberTest.php   
 ------ ---------------------------------------------- 
  83     Call to deprecated method getMock() of class  
         Drupal\Tests\UnitTestCase.                    
  95     Call to deprecated method getMock() of class  
         Drupal\Tests\UnitTestCase.                    
  96     Call to deprecated method getMock() of class  
         Drupal\Tests\UnitTestCase.                    
  97     Call to deprecated method getMock() of class  
         Drupal\Tests\UnitTestCase.                    
  98     Call to deprecated method getMock() of class  
         Drupal\Tests\UnitTestCase.                    
  100    Call to deprecated method getMock() of class  
         Drupal\Tests\UnitTestCase.                    
  102    Call to deprecated method getMock() of class  
         Drupal\Tests\UnitTestCase.                    
  105    Call to deprecated method getMock() of class  
         Drupal\Tests\UnitTestCase.                    
  253    Call to deprecated method getMock() of class  
         Drupal\Tests\UnitTestCase.                    
 ------ ---------------------------------------------- 

 [ERROR] Found 10 errors                                                    

 

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

mcdwayne created an issue. See original summary.

sergiu stici’s picture

Status: Active » Needs review
StatusFileSize
new6.44 KB

Here is the patch, please review.

Status: Needs review » Needs work

The last submitted patch, 2: drupal_9_deprecated_code-3042799-2.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

gun2dru’s picture

Hello @mcdwayne,
Please review.

gun2dru’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 4: r4032login-fix-deprecation-3042799-4-d8.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

anavarre’s picture

+++ b/src/EventSubscriber/R4032LoginSubscriber.php
@@ -166,7 +166,7 @@ class R4032LoginSubscriber extends HttpExceptionSubscriberBase {
+          \Drupal::messenger()->addMessage(Xss::filterAdmin($message), $messageType);

This should use dependency injection instead.

Also, there are still failures on the testbot:

1) Drupal\Tests\r4032login\Functional\RedirectTest::testSkipRedirect with data set #0 ('/admin/config/development', array(), 403, '/admin/config/development')
Behat\Mink\Exception\ExpectationException: Current response status code is 200, but 403 expected.

/var/www/html/vendor/behat/mink/src/WebAssert.php:770
/var/www/html/vendor/behat/mink/src/WebAssert.php:130
/var/www/html/modules/contrib/r4032login/tests/src/Functional/RedirectTest.php:46

2) Drupal\Tests\r4032login\Functional\RedirectTest::testSkipRedirect with data set #2 ('/admin/modules', array(array('bar')), 403, '/admin/modules?foo=bar')
Behat\Mink\Exception\ExpectationException: Current response status code is 200, but 403 expected.

/var/www/html/vendor/behat/mink/src/WebAssert.php:770
/var/www/html/vendor/behat/mink/src/WebAssert.php:130
/var/www/html/modules/contrib/r4032login/tests/src/Functional/RedirectTest.php:46
jkswoods’s picture

StatusFileSize
new8.81 KB
new6.51 KB

Updated patch to use dependency injection. Tests are passing locally, so we'll see what testbot says...

jkswoods’s picture

Status: Needs work » Needs review
lilit_ghazaryan’s picture

lilit_ghazaryan’s picture

StatusFileSize
new3.59 KB
lilit_ghazaryan’s picture

StatusFileSize
new4.02 KB
pminf’s picture

Status: Needs review » Needs work

#7 wasn't addressed, working on this now.

pminf’s picture

Status: Needs work » Needs review
StatusFileSize
new8.86 KB
new6.48 KB

Oh, patch from #10 (#11 and #12) did not contain changes from #8, which already addressed #7 with dependency injection. I have combined patch #10 and #12 and finally removed the obsolete function "drupal_set_message()" from the unit test.

pminf’s picture

gogowitsch’s picture

@pminf: there are 2 things to improve from my perspective:

  1. Remove the space after the arrow:

    $kernel = $this-> createMock('Symfony\Component\HttpKernel\HttpKernelInterface');
  2. @param MessengerInterface $messenger;: the trailing ; needs to be removed
katzilla’s picture

Changed last recommendations from @gogowisch and applied a new patch. Tested and reviewed - works fine, all errors from drupal-check are gone after applying.

katzilla’s picture

Forgot one semikolon ^^

pminf’s picture

Status: Needs review » Reviewed & tested by the community

Thanks! #17 and #18 addressed #16. Everything should be fine now.

damienmckenna’s picture

Title: Drupal 9 Deprecated Code Report » Drupal 9 Deprecated Code Report for R4032Login module
jkswoods’s picture

edysmp’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new408 bytes
new9.83 KB

Get info file compatilble with Drupal 9

See: https://www.drupal.org/node/3070687

edysmp’s picture

StatusFileSize
new9.27 KB

Adding correct patch file.

smrutha’s picture

Status: Needs review » Reviewed & tested by the community

Patch #23 works for me.

drupal-check -d web/modules/contrib/r4032login
15/15 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

[OK] No errors

fabianderijk’s picture

Works like a charm!

dbielke1986’s picture

Works for me, too.
I would welcome an official release.

:-)

martijn de wit’s picture

A new release for D9 would be great indeed :)

grasmash’s picture

Or even just a commit to a dev branch! :)

grasmash’s picture

For those who need to use this module with Drupal 9 now, feel free to use my fork (which has the patch committed):

{
    "repositories": {
        "r4032login": {
            "type": "vcs",
            "url": "git@github.com:grasmash/drupal-r4032login.git"
        }
    },
    "require": {
        "drupal/r4032login": "8.x-1.x-dev"
    }
}
grimreaper’s picture

Hello,

Thanks everyone for working on this.

From what I see, only maintainers action is needed now. Or am I missing something?

Is a new maintainer needed for the module? Because none has replied to this issue or #3148547: Automated Drupal 9 compatibility fixes.

nixou’s picture

Thanks you everyone.

I take the point this morning :

  • New branch 2.x for the new version compatible with drupal 8 and drupal 9
  • Check if test pass on drupal 8 and drupal 9 with this patch
  • If all tests are ok, I'll create a new release 2.0.0
nixou’s picture

Version: 8.x-1.x-dev » 2.x-dev
nixou’s picture

StatusFileSize
new8.87 KB

I committed directly to the 2.x branch the .info modification so I hope I can run test without composer error then.

I attach the reroll patch without the .info modification part.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 33: 3042799-33.patch, failed testing. View results

nixou’s picture

StatusFileSize
new15.6 KB

We need to adapt fuctionnal test by adding default theme as required by https://www.drupal.org/node/3083055.

nixou’s picture

Status: Needs work » Needs review

  • Nixou committed d89bcb4 on 2.x
    Issue #3042799 by Lilit_Ghazaryan, katzilla, edysmp, Nixou, pminf,...
nixou’s picture

Status: Needs review » Fixed
grimreaper’s picture

Thanks!

martinhansen’s picture

Excellent!

Status: Fixed » Closed (fixed)

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