Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[Bug]: occ theming:config <imageKey>` reads from wrong storage key

Abierto Apto para principiantes
#60,173 1 comentario 2 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@shawon9324 ya está trabajando en esto.

Desde el 15/9/2026.

  • #64381 de @shawon9324 — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
72/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Tranquilo
Stack tecnológico
php
Área
backend, cli

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

1. to develop 33-feedback bug feature: theming
⚠️ This issue respects the following points: ⚠️
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
  1. 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"
    
  2. Confirm the logo is being served — visit the NC web UI; the custom logo
    appears in the header.

  3. 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

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de nextcloud/server

Todos los issues de nextcloud/server

Issues similares

Más issues de PHP

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.