Skip to content

Upgrading from 1.x to 2.0#

The 2.0 release of the BankID module introduces a modular, plugin-based architecture with separate submodules for login and signing workflows, Drupal 11.4+ compatibility, and strict value objects.


Automated Upgrade Path#

When upgrading an existing 1.0.x site via composer require drupal/bankid:^2.0 and running database updates (drush updb), the automated update hook (bankid_update_20001) automatically performs the following tasks:

  1. Installs the bankid_login submodule conditionally: In 1.0.x, login was part of the base module. In 2.0, login is decoupled into the bankid_login submodule. If the site had the 1.0.x authenticate block (bankid_authenticate_block) placed, bankid_login is automatically installed to preserve existing user login functionality without manual intervention.
  2. Migrates configuration: If bankid_login is installed, copies create_user and redirect_path from bankid.settings into bankid_login.settings, and sets the default login_case plugin to login.
  3. Migrates external authentication mapping: Updates existing provider records in the authmap table from bankid to bankid_login.
  4. Migrates Block layout: Reconfigures any placed bankid_authenticate_block instances to bankid_login_block with updated module dependencies.
  5. Cleans up bankid.settings: Removes legacy 1.0.x keys (create_user, redirect_path, integration) to conform strictly to the 2.0 configuration schema.

Backward Compatibility Layer#

To prevent breaking changes or fatal errors on upgrade:

  • Block fallback: A deprecated bankid_authenticate_block plugin is provided by bankid_login as a fallback alias.
  • Form fallback: The legacy form class \Drupal\bankid\Form\BankIDAuthenticateForm is retained as a deprecated subclass extending \Drupal\bankid_login\Form\BankIDLoginForm.

Manual Changes to Review#

1. Twig Templates#

If your site or theme embeds the login form via Twig Tweak, update the class reference:

Old (1.x):

1
{{ drupal_form('Drupal\\bankid\\Form\\BankIDAuthenticateForm') }}

New (2.x):

1
{{ drupal_form('Drupal\\bankid_login\\Form\\BankIDLoginForm') }}

2. Custom Integration Plugins#

In 1.x, custom integrations extended IntegrationBase. In 2.0, this plugin type has been replaced by the BankIDCase plugin architecture:

  • Custom login or sign logic should be rewritten as a plugin in src/Plugin/BankIDCase/ extending BankIDCasePluginBase, BankIDLoginCaseBase, or BankIDSignCaseBase.
  • See the Creating a plugin guide for details.

3. Drupal Core Requirement#

BankID 2.0 requires Drupal 11.4 or higher. Sites on Drupal 10 or earlier Drupal 11 minors must update Drupal core prior to upgrading BankID to 2.0.