[Bug]: occ theming:config <imageKey>` reads from wrong storage key
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 72/100
Línea de trabajo
Comienza por apps/theming/lib/Command/UpdateConfig.php alrededor de la línea 84 y compara la lectura de una sola clave con la rama que lista todas las claves y con ImageManager::getImage(), que utilizan la convención de almacenamiento de MIME de imágenes. Reproduce el problema con occ theming:config logo después de establecer un logo y confirma luego que la lectura informa del tipo MIME almacenado, como image/png.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
⚠️ 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
occ theming:config <imageKey> (where <imageKey> is background, logo,
logoheader, or favicon) always reports "is currently not set" even when
the value IS set and the UI serves it correctly. The read-back code reads
from theming.<key> but image values are stored at theming.<key>Mime.
Fix is 9 lines in apps/theming/lib/Command/UpdateConfig.php (around
line 84). Display value is the MIME type, matching the existing set-path
echo convention.
Bug present since **NC 21.0.0** (commit
[`9b7bdfef79c8`](https://github.com/nextcloud/server/commit/9b7bdfef79c8))
Potential Patch
diff --git a/apps/theming/lib/Command/UpdateConfig.php b/apps/theming/lib/Command/UpdateConfig.php
index 6236f8664456..f10aaee0d0b3 100644
--- a/apps/theming/lib/Command/UpdateConfig.php
+++ b/apps/theming/lib/Command/UpdateConfig.php
@@ -82,7 +82,15 @@ class UpdateConfig extends Command {
}
if ($value === null) {
- $value = $this->config->getAppValue('theming', $key, '');
+ // Image-type keys (background, logo, logoheader, favicon) are stored
+ // at "<key>Mime" in app config — same convention the list-all branch
+ // above and ImageManager::getImage() use. Without this remap, the
+ // single-key read always returns '' for image keys regardless of
+ // whether one is set.
+ $storageKey = in_array($key, ImageManager::SUPPORTED_IMAGE_KEYS, true)
+ ? $key . 'Mime'
+ : $key;
+ $value = $this->config->getAppValue('theming', $storageKey, '');
if ($value !== '') {
$output->writeln('<info>' . $key . ' is currently set to ' . $value . '</info>');
} else {
Steps to reproduce
-
On a fresh Nextcloud 33.0.3 instance, set a logo via the admin Theming
UI or OCC:occ theming:config logo /path/to/logo.png # → "Updated logoMime to image/png" -
Confirm the logo is being served — visit the NC web UI; the custom logo
appears in the header. -
Read the value back via OCC:
occ theming:config logo
Expected behavior
logo is currently set to image/png (or whatever MIME type was uploaded).
I would suggest returning the URL with v=tag would be more useful but for consistency this seems like the expectation
Nextcloud Server version
33
Present since v21
Operating system
None
PHP engine version
None
Web server
None
Database engine version
None
Is this bug present after an update or on a fresh install?
None
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
- Default user-backend (database)
- LDAP/ Active Directory
- SSO - SAML
- Other
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
No response
- Lenguaje dominante
- PHP
- Estrellas
- 37k
- Forks
- 5.3k
- Merge medio
- 1 d 23 h
- PR fusionados (30 d)
- 742
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de nextcloud/server
-
0. Needs triage 35-feedback bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
34-feedback
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Add a default limit to the results of the `occ taskprocessing:list` commandPosiblemente ocupada @Sahas2711 la tomó hace 1 día. Abiertoenhancement feature: TaskProcessing good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
1. to develop technical debt
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
0. Needs triage 35-feedback bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
Todos los issues de nextcloud/server
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
crazy-goat/rabbit-stream#830 ·
Los mantenedores suelen responder en 1 día
-
sync-en
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
sync-en
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 4 días
-
Перевод устарел
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Combination form: image thumbnails collapse to 0×0 when a stylesheet sets `img { max-width: 100% }`Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
PrestaShop/PrestaShop#43200 ·
Los mantenedores suelen responder en 1 día