Drupal 11 compatibility fixes for certificatelogin

Created on 5 October 2024, 6 months ago

Problem/Motivation

Currently, is not possible download and install this project in Drupal 10+. Probably only a few tweaks and tunes are required to get it up and running but since the ProjectUpdateBot seems not interested in doing it I'm stepping up and moving forward with it.

Steps to reproduce

  • Create a new Drupal 11 project
  • Try to add the module using Composer
  • Go and cry away from public in a dark corner

Proposed resolution

Just make it work.

Remaining tasks

  • Run upgrade_status check list.
  • Run drupal-rector
  • (optionally) Ad necessary files to use D.O CI/CD.

User interface changes

N/A

API changes

N/A (probably)

Data model changes

N/A

📌 Task
Status

Active

Version

2.0

Component

Code

Created by

🇪🇸Spain d70rr3s

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @d70rr3s
  • 🇪🇸Spain d70rr3s

    Running upgrade_status analyse

    ================================================================================
    Certificate Login, --
    Scanned on Sat, 10/05/2024 - 16:01
    
    FILE: web/modules/contrib/certificatelogin/tests/src/Functional/LoadTest.php
    
    STATUS         LINE                           MESSAGE                           
    --------------------------------------------------------------------------------
    Check manually 13   Drupal\Tests\BrowserTestBase::$defaultTheme is required. See
                        https://www.drupal.org/node/3083055, which includes         
                        recommendations on which theme to use.                      
    --------------------------------------------------------------------------------
    Check manually 20   Property                                                    
                        Drupal\Tests\certificatelogin\Functional\LoadTest::$modules 
                        property must be protected.                                 
    --------------------------------------------------------------------------------
    
    FILE: web/modules/contrib/certificatelogin
    
    STATUS         LINE                           MESSAGE                           
    --------------------------------------------------------------------------------
    Check manually 0    The 'certificatelogin' extension is not installed. Cannot   
                        check deprecated library use.                               
    --------------------------------------------------------------------------------
    
    FILE:
    web/modules/contrib/certificatelogin/src/Plugin/Block/CertificateLoginBlock.php
    
    STATUS         LINE                           MESSAGE                           
    --------------------------------------------------------------------------------
    Check manually 39   The 'certificatelogin/certificatelogin' library is not      
                        defined because the defining extension is not installed.    
                        Cannot decide if it is deprecated or not.                   
    --------------------------------------------------------------------------------
    
    FILE: web/modules/contrib/certificatelogin/certificatelogin.info.yml
    
    STATUS         LINE                           MESSAGE                           
    --------------------------------------------------------------------------------
    Check manually 5    Value of core_version_requirement: ^8 || ^9 is not          
                        compatible with the next major version of Drupal core. See  
                        https://drupal.org/node/3070687.                            
    --------------------------------------------------------------------------------
    
  • 🇪🇸Spain d70rr3s

    Running drupal-rector

    [file] /var/www/html/web/modules/contrib/certificatelogin/certificatelogin.install
    [file] /var/www/html/web/modules/contrib/certificatelogin/certificatelogin.module
    [file] /var/www/html/web/modules/contrib/certificatelogin/src/Annotation/CaSignatureVerificationPlugin.php
    [file] /var/www/html/web/modules/contrib/certificatelogin/src/Controller/CertificateLoginController.php
    [file] /var/www/html/web/modules/contrib/certificatelogin/src/Form/CertificateLoginSettingsForm.php
    [file] /var/www/html/web/modules/contrib/certificatelogin/src/Form/ConfirmForm.php
    [file] /var/www/html/web/modules/contrib/certificatelogin/src/Form/LoginForm.php
    [file] /var/www/html/web/modules/contrib/certificatelogin/src/Plugin/Block/CertificateLoginBlock.php
    [file] /var/www/html/web/modules/contrib/certificatelogin/src/Plugin/CaSignatureVerificationPlugin/PHPSecLib.php
    [file] /var/www/html/web/modules/contrib/certificatelogin/src/Plugin/CaSignatureVerificationPluginBase.php
    [file] /var/www/html/web/modules/contrib/certificatelogin/src/Plugin/CaSignatureVerificationPluginInterface.php
    [file] /var/www/html/web/modules/contrib/certificatelogin/src/Plugin/CaSignatureVerificationPluginManager.php
    [file] /var/www/html/web/modules/contrib/certificatelogin/src/Plugin/Menu/LoginLogoutMenuLink.php
    [file] /var/www/html/web/modules/contrib/certificatelogin/src/Service/LoginRegisterService.php
    [file] /var/www/html/web/modules/contrib/certificatelogin/tests/src/Functional/LoadTest.php
    
    1 file with changes
    ===================
    
    1) web/modules/contrib/certificatelogin/tests/src/Functional/LoadTest.php:12
    
        ---------- begin diff ----------
    @@ @@
     class LoadTest extends BrowserTestBase {
    
       /**
    +   * {@inheritdoc}
    +   */
    +  protected $defaultTheme = 'stark';
    +
    +  /**
    +   * {@inheritdoc}
    +   */
    +  protected $defaultTheme = 'stark';
    +
    +  /**
        * Modules to enable.
        *
        * @var array
        */
    -  public static $modules = ['certificatelogin'];
    +  protected static $modules = ['certificatelogin'];
    
       /**
        * A user with permission to administer site configuration.
    @@ @@
       /**
        * {@inheritdoc}
        */
    -  protected function setUp() {
    +  protected function setUp(): void {
         parent::setUp();
         $this->user = $this->drupalCreateUser(['administer site configuration']);
         $this->drupalLogin($this->user);
        ----------- end diff -----------
    
    Applied rules:
     * FunctionalTestDefaultThemePropertyRector
     * ProtectedStaticModulesPropertyRector
     * AddReturnTypeDeclarationRector
    
    
     [OK] 1 file would have been changed (dry-run) by Rector                                                                
    
  • 🇪🇸Spain d70rr3s

    This only introduces minimal changes to be dowloaded and enabled. Write now the .install contains leftover code from a previous refactor and I sincerely doubt that the module will work out of the box with D10+. I will open another issue to work on that.

Production build 0.71.5 2024