Problem/Motivation

The problem: bs_lib.module still has template_preprocess_bs_lib_toggle_button(). It merges #options into the variables of the bs_lib_toggle_button template. Drupal 11.3 deprecates finding this function by its name, and Drupal 12 removes it, so the preprocess would silently stop running. Toggle buttons would then render without their attributes.

Proposed resolution

1. Add 'initial preprocess' => static::class . ':preprocessBsLibToggleButton' to bs_lib_toggle_button in BsLibHooks::theme().
2. Move the function's body into a new BsLibHooks::preprocessBsLibToggleButton(array &$variables): void.
3. Keep template_preprocess_bs_lib_toggle_button() as a thin wrapper that calls the method, for Drupal before 11.2.

Remaining tasks

Implement.

User interface changes

None.

API changes

None.

Data model changes

None.

Issue fork bs_lib-3628471

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

pivica created an issue. See original summary.

  • pivica committed d4c8fe80 on 2.0.x
    fix: #3628471 bs_lib_toggle_button preprocess stops running on Drupal 12
    
pivica’s picture

Status: Active » Fixed

Done.

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.

Status: Fixed » Closed (fixed)

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