Start quiz button breaks multilingual site language selection

Created on 3 May 2022, over 2 years ago
Updated 9 August 2024, 5 months ago

Problem/Motivation

When you have a multilingual site and you have an interface language RU selected (or any non-default) and you 'Start quiz', the language selection will jump to the default language or the language selector.

Steps to reproduce

Create questions inside a quiz
Have a multilingual site and select a non-default language
Go to the quiz description/canonical page (i.e. quiz/1)
Press 'Start quiz' and you will jump to a different language or language selector will pop up (depending on config)

Proposed resolution

A fast fix is if we put the `'language' => $this->languageManager->getCurrentLanguage()`, line inside the `src/View/QuizViewBuilder.php` file where the link is generated (`->toLink($this->t('Start @quiz', ['@quiz' => QuizUtil::getQuizName()]), 'take', [`).

My guess according to the Drupal core is that this happens because the entity does not support translation, so when the https://www.drupal.org/project/quiz/issues/3180283 ✨ Drupal 8+ Translation Support? Needs work issue will be solved probably this issue will be outdated.

Remaining tasks

TBD

User interface changes

-

API changes

-

Data model changes

-

πŸ› Bug report
Status

Fixed

Version

7.0

Component

Code - Quiz core

Created by

πŸ‡§πŸ‡ͺBelgium golddragon007

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.

Production build 0.71.5 2024