Disabling administration pages language field when "Force language" option is selected

Created on 20 March 2023, over 1 year ago
Updated 18 August 2023, 11 months ago

Problem/Motivation

By selecting the "Force language" option in this module's settings, the user can still try to change the "Administration pages language" field when editing his profile.
Although the field is rewritten when the user is saved, I believe that leaving the user field disabled is a better UI practice.

Steps to reproduce

  1. Install the module.
  2. Navigate to module configuration page. (/admin_user_language/settings)
  3. Select language for default value. For example English.
  4. Select the "Force language" option.
  5. Save changes.
  6. Edit a user's profile.
  7. Check that the "Administration pages language" field is editable.

Proposed resolution

Through the hook admin_user_language_form_user_form_alter, verify the field exists and, if it exists and the "Force language" option is selected, deactivate the field.

Remaining tasks

None.

User interface changes

The "Administration pages language" field in the user profile will appear disabled if the "Force language" setting is enabled.

API changes

None.

Data model changes

None.

✨ Feature request
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡΅πŸ‡ΉPortugal lolgm

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

Comments & Activities

Production build 0.69.0 2024