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:
- Installs the
bankid_loginsubmodule conditionally: In 1.0.x, login was part of the base module. In 2.0, login is decoupled into thebankid_loginsubmodule. If the site had the 1.0.x authenticate block (bankid_authenticate_block) placed,bankid_loginis automatically installed to preserve existing user login functionality without manual intervention. - Migrates configuration: If
bankid_loginis installed, copiescreate_userandredirect_pathfrombankid.settingsintobankid_login.settings, and sets the defaultlogin_caseplugin tologin. - Migrates external authentication mapping: Updates existing provider records in the
authmaptable frombankidtobankid_login. - Migrates Block layout: Reconfigures any placed
bankid_authenticate_blockinstances tobankid_login_blockwith updated module dependencies. - 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_blockplugin is provided bybankid_loginas a fallback alias. - Form fallback: The legacy form class
\Drupal\bankid\Form\BankIDAuthenticateFormis 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 | |
New (2.x):
1 | |
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/extendingBankIDCasePluginBase,BankIDLoginCaseBase, orBankIDSignCaseBase. - 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.