[Bug]: Undefined array key 0 at ***/apps/settings/lib/Settings/Personal/PersonalInfo.php with reduce_to_languages option
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github OR Nextcloud Community Forum (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- I agree to follow Nextcloud's Code of Conduct.
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:
instead of the expected:
Steps to reproduce
- Go to
https://***/settings/user - Choose e.g.
English (Britain English)or any other language not set / configured in the next step - Set / add
'reduce_to_languages' => ['en'],to config.php - Go to
https://***/settings/useragain - Check log files
Expected behavior
- The error in the logs is not showing up
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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