Problem/Motivation

The message_banner module is incompatible with Drupal 11 due to several issues:

1. ConfigFormBase constructor change - In Drupal 11, ConfigFormBase::__construct() requires a second parameter (TypedConfigManagerInterface). The current code calls parent::__construct($config_factory) which causes ArgumentCountError: Too few arguments to function Drupal\Core\Form\ConfigFormBase::__construct().
2. Incorrect config schema type - The config schema uses type: config_entity but this is simple configuration, not a config entity. Should be type: config_object.
3. Deprecated AccountInterface constants - The install hook uses AccountInterface::AUTHENTICATED_ROLE and AccountInterface::ANONYMOUS_ROLE which are deprecated.
4. Missing PHP 8.1+ features - Properties lack type declarations, methods lack return types.

Steps to reproduce

1. Install Drupal 11
2. Install message_banner module
3. Navigate to /admin/config/user-interface/message-banner
4. Error: ArgumentCountError: Too few arguments to function Drupal\Core\Form\ConfigFormBase::__construct()

Proposed resolution

1. Use parent::create() pattern for D11 ConfigFormBase compatibility (per https://www.drupal.org/node/3404140)
2. Fix config schema: config_entity → config_object
3. Replace deprecated AccountInterface constants with string literals
4. Add typed properties and return types
5. Update core_version_requirement to ^10.3 || ^11
6. Update composer.json with PHP 8.1+ requirement

Remaining tasks

- Review and test
- Merge

User interface changes

none

API changes

none

Data model changes

None (config schema type correction is a fix, not a change to stored data)

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

oivanov created an issue. See original summary.

oivanov’s picture

Status: Active » Needs review

the MR is ready for review

sophie.sk’s picture

Version: 2.0.x-dev » 3.0.x-dev
Assigned: Unassigned » sophie.sk
Status: Needs review » Fixed
Related issues: +#3433363: Automated Drupal 11 compatibility fixes for message_banner

Thanks for the work on this. Committing the fix and crediting lfersoy and dieterholovet from #3433363: Automated Drupal 11 compatibility fixes for message_banner.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • sophie.sk committed 242b7e39 on 3.0.x
    feat: #3565290 Drupal 11 compatibility: ConfigFormBase fix, config...

Status: Fixed » Closed (fixed)

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