[Bug]: occ theming:config <imageKey>` reads from wrong storage key
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
apps/theming/lib/Command/UpdateConfig.php の84行目付近から始め、単一キーの読み取りを、すべてのキーを一覧表示する分岐および ImageManager::getImage() と比較してください。これらは画像 MIME の保存規約を使用しています。ロゴを設定した後に occ theming:config logo で問題を再現し、読み取り結果に image/png などの保存された MIME タイプが報告されることを確認してください。
索引モデルが issue の本文から書いたものです。
説明
⚠️ 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
- 主要言語
- PHP
- スター
- 37k
- フォーク
- 5.3k
- 平均マージ
- 1日 20時間
- マージ済み PR(30日)
- 720
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nextcloud/server のほかの issue
-
0. Needs triage 35-feedback bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
34-feedback
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
Add a default limit to the results of the `occ taskprocessing:list` command対応中かも @Sahas2711 が 2 日前に担当しました。 オープンenhancement feature: TaskProcessing good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
1. to develop technical debt
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
0. Needs triage 35-feedback bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
nextcloud/server の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
components-web-app/api-components-bundle#403 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
mollie/PrestaShop#1566 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
components-web-app/docs#193 ·
-
docs: add Python and PHP examples to docs/api.md対応中かも @gaurika-analyst が今日担当しました。 オープンdocumentation good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
djazairdev/wilayas#12 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
endoflife-date/endoflife.date#11314 ·
メンテナーはふだん 1 日以内に返信