nextcloud / nextcloud/server

[Bug]: Undefined array key 0 at ***/apps/settings/lib/Settings/Personal/PersonalInfo.php with reduce_to_languages option

Open
#50,980 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage 30-feedback bug feature: language/translations (l10n/i18n) feature: settings
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

⚠️ This issue respects the following points: ⚠️
Bug description

After configuring the reduce_to_languages config.php option and having a user which had already configured a now not anymore allowed / available language the given error below is shown in the logs.

Furthermore the following is shown on the personal setting page of that user:

Image

instead of the expected:

Image

Steps to reproduce
  1. Go to https://***/settings/user
  2. Choose e.g. English (Britain English) or any other language not set / configured in the next step
  3. Set / add 'reduce_to_languages' => ['en'], to config.php
  4. Go to https://***/settings/user again
  5. Check log files
Expected behavior
  1. The error in the logs is not showing up
  2. Optional: The user is get a note / warning on the personal setting that e.g. a different language should be used and the current language is not "allowed" (not sure if the setting should disallow the language in general)
Nextcloud Server version

30.0.6

Operating system

Should be irrelevant bug can be provided if really required.

PHP engine version

Should be irrelevant bug can be provided if really required.

Web server

Should be irrelevant bug can be provided if really required.

Database engine version

Should be irrelevant bug can be provided if really required.

Is this bug present after an update or on a fresh install?

Update

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?
  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other
Configuration report
Should be irrelevant bug can be provided if really required.
List of activated Apps
Should be irrelevant bug can be provided if really required.
Nextcloud Signing status
Should be irrelevant bug can be provided if really required.
Nextcloud Logs
{"reqId":"***","level":3,"time":"***","remoteAddr":"***","user":"***","app":"PHP","method":"GET","url":"/settings/user","message":"Undefined array key 0 at ***/apps/settings/lib/Settings/Personal/PersonalInfo.php#280","userAgent":"***","version":"30.0.6.2","data":{"app":"PHP"}}
Additional info

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in apps/settings/lib/Settings/Personal/PersonalInfo.php around line 280 and reproduce the issue by selecting a language, setting reduce_to_languages to ['en'], and revisiting /settings/user. Trace the handling of a previously selected language that is no longer allowed, then verify that the log error is gone and the personal settings page handles that state as intended.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, internationalization
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.