Make dropdown language block cacheable

Created on 18 April 2022, about 3 years ago
Updated 16 March 2023, about 2 years ago

Problem/Motivation

As per https://www.drupal.org/project/drupal/issues/2232375 📌 Make language switcher block cacheable Postponed , we need to make the dropdown language block cacheable as well.

Related issue: https://www.drupal.org/project/drupal/issues/2888838 🌱 Optimize render caching Needs work

📌 Task
Status

Needs review

Version

2.0

Component

Code

Created by

🇵🇰Pakistan hmdnawaz

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • 🇩🇪Germany Anybody Porta Westfalica
  • 🇩🇪Germany Anybody Porta Westfalica
  • @anybody opened merge request.
  • 🇩🇪Germany Anybody Porta Westfalica

    Postponed on 📌 Make language switcher block cacheable Postponed

  • Status changed to Postponed almost 2 years ago
  • 🇧🇪Belgium flyke

    I had this annoying thing in my project when sometimes when you open a page the dropbutton would display as open so you see all the language links but the triangle down icon was missing, and sometimes it would work, showing only the current language with the dropdown button (triangle down icon) next to it. Refreshing the page is like playing russian roulette on whether the dropdown language would work or not. about 3/5 of the time it would not work correctly.

    When it does not work correctly, the wrapper looks like this:
    <div class="dropbutton-wrapper">
    Also the <li> elements are missing classes like dropbutton-action

    When it works correctly, the wrapper looks like this:
    <div class="dropbutton-wrapper dropbutton-multiple" data-drupal-ajax-container="" data-once="dropbutton">
    and the li elements inside have their correct classes.

    Adding this (applied the MR on 4.0.3) fixed this issue for me.

Production build 0.71.5 2024