It's not possible to change the order of languages

Created on 12 October 2023, 9 months ago
Updated 22 February 2024, 4 months ago

Problem/Motivation

in rocketship_core_form_language_admin_overview_form_alter we disallow changing the default language to avoid issues
but the way we do it (disabling the radio buttons) also makes reordering the languages impossible since the default language value is not submitted (since it's disabled) and fails the validation

Steps to reproduce

go to /admin/config/regional/language and try to reorder and languages then save the form
you will get "Selected default language no longer exists." error

Proposed resolution

instead of disabling, maybe hide the radios (use a hidden field for the 'default' value) and show a text instead

🐛 Bug report
Status

Active

Version

6.1

Component

Code

Created by

🇷🇴Romania reszli Târgu Mureș

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

Comments & Activities

  • Issue created by @reszli
  • 🇮🇳India SandeepSingh199

    Hi @reszli, I am unable to replicate the issue in local.

    Steps to Verify :-
    1. Get clone of composer require 'drupal/rocketship_core:6.1.x-dev@dev'.
    2. Enable the module drush en rocketship_core.
    3. Moved to /admin/config/regional/language page.
    4. Added four languages.
    5. Re-ordered the language & Saved.
    6. Displays a successful message.

    Can you please give a screenshots of your steps. It will help us to analyse the issue

  • As a hotfix for development i temporarily commented out the $form['languages'][$langcode]['default']['#disabled'] = TRUE; in rocketship_core_form_language_admin_overview_form_alter. This allowed me to make the changes and save the language order.

Production build 0.69.0 2024