`wp theme mod set` prints its failure message as `Success` and exits 0
評估
研究方向
閱讀 Theme_Mod_Command::set(),issue指出這裡會偵測到不相符的值並印出失敗訊息。檢查相鄰命令失敗時如何回報錯誤並設定結束狀態;使用描述的篩選器 pre_set_theme_mod_background_color 重現問題。完成標準是命令印出 Error: Could not update theme mod background_color. 並以代碼 1 結束。
由索引模型根據 Issue 內容生成。
描述
When wp theme mod set cannot save the value, it prints the failure through WP_CLI::success():
$ wp theme mod set background_color 123456
Success: Could not update theme mod background_color.
$ echo $?
0
To reproduce, add a pre_set_theme_mod_background_color filter that returns a different value (for example from a mu-plugin). Theme_Mod_Command::set() reads the mod back, sees it does not match, and calls WP_CLI::success( "Could not update theme mod {$mod}." ). Scripts that check the exit code treat the failure as a success.
Expected: Error: Could not update theme mod background_color. with exit code 1.
- 主要語言
- Gherkin
- 星號
- 90
- 分支
- 87
- 平均合併
- 2 天 7 小時
- 30 天內合併 PR
- 3
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
wp-cli/extension-command 的其他 Issue
-
Download update packages concurrently before running the bulk upgrader可能已有人在做 @austinginder 於 51 天前認領。 未關閉command:plugin-update command:theme-update
難度 4/5 3-5 天 新手友好度 48/100
wp-cli/extension-command#555 · 2 則留言 ·
-
opcache invalidation可能已有人在做 @swissspidy 於 266 天前認領。 未關閉command:plugin-update command:theme-update
wp-cli/extension-command#444 · 10 則留言 · 1 個 reaction · 已指派 2 人 ·
-
Add wp theme cache command可能已有人在做 @swissspidy 於 278 天前認領。 未關閉command:theme state:unconfirmed
wp-cli/extension-command#392 · 9 則留言 · 1 個 reaction · 已指派 2 人 ·
查看 wp-cli/extension-command 的全部 Issue
相似的 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 80/100
-
難度 2/5 1-3 小時 新手友好度 68/100
max-sixty/worktrunk#4727 · 7 則留言 · 1 個 reaction ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
devantler-tech/ksail#8256 · 1 則留言 ·
維護者通常 1 天內回覆
-
agent-self
難度 1/5 1 小時以內 新手友好度 88/100
yologdev/yoyo-evolve#1154 ·
-
難度 2/5 1-3 小時 新手友好度 78/100
NousResearch/hermes-agent#150973 ·
維護者通常 1 天內回覆