TMDO_Quotation::register() 舊版偵測 TMQUO_Main / TMQUO_Plugin 兩個類別, 在 partner 外掛中並不存在(或載入太晚),偵測實際完全靠 file_exists() 後備 撐著——程式碼讀起來像在驗證「partner 已載入」,實際只驗證了「目錄存在」。 改用 TMQUO_VERSION / TMQUO_PLUGIN_DIR,兩者在 partner 主檔的檔案解析當下即 define,早於 plugins_loaded,故本 AddOn bootstrap 的 :6 時點確實可用。 file_exists() 後備保留不動,行為不變;但偵測不再是死碼,即使將來移除後備也 不會重演 infocards-addon 那種「整個 AddOn 靜默失效」的事故。 同一版本另含先前未提交的 schema 工作:補齊 expected_columns / indexes, 並將 registry 索引 config key 由 expected_indexes 更正為 indexes (wp_parse_args() 會靜默丟棄未知 key,索引期望值先前等同從未送達)。 實測驗證(mu-plugin 於 plugins_loaded:6 量測真實請求): 新常數 AVAILABLE;wp wpdo doctor 89 OK / 0 FAIL;表註冊欄位與索引 100% 完整。
This commit is contained in:
@@ -13,6 +13,33 @@ Versioning follows [Semantic Versioning](https://semver.org/).
|
||||
|
||||
---
|
||||
|
||||
## [0.1.1] — 2026-08-08 — 8 張 `2mq_*` 表補齊 schema 期望值
|
||||
|
||||
### Added
|
||||
|
||||
- 為全部 8 張 `2mq_*` 表補上 `expected_columns` 與 `indexes`:`2mq_quotations`、
|
||||
`2mq_quotation_items`、`2mq_quotation_history`、`2mq_vendor_presets`、
|
||||
`2mq_catalog_categories`、`2mq_catalog_items`、`2mq_quotation_templates`、
|
||||
`2mq_vendor_catalog_prices`。欄位與索引逐項轉錄自 2meet-quotation activator 的
|
||||
`CREATE TABLE`。先前只註冊表名,`wp wpdo doctor` 只知道表存在,無從判斷欄位或
|
||||
索引是否漂移。
|
||||
|
||||
### Fixed
|
||||
|
||||
- `TMDO_Custom_Table_Registry::register()` 的索引期望值 config key 由
|
||||
`expected_indexes` 更正為 `indexes`。該 API 以 `wp_parse_args()` 併入預設值,
|
||||
未知 key 會被**靜默丟棄**——先前索引期望值等同從未送達 registry,
|
||||
`wp wpdo doctor` 的 schema drift 只驗欄位、不驗索引。此問題橫跨全部 8 個 AddOn,
|
||||
已一併更正。
|
||||
- `TMDO_Quotation::register()` 的 partner 偵測符號對齊實際存在的常數。舊版偵測
|
||||
`TMQUO_Main` / `TMQUO_Plugin` 兩個類別,但這兩者在 2meet-quotation 中**根本不存在**,
|
||||
偵測實際完全靠 `file_exists()` 後備撐著。改用 `TMQUO_VERSION` / `TMQUO_PLUGIN_DIR`,
|
||||
兩者在主檔檔案解析當下即 define,早於 `plugins_loaded`。
|
||||
實測(mu-plugin 於 `plugins_loaded:6` 量測):`TMQUO_VERSION` = AVAILABLE。
|
||||
`file_exists()` 後備保留不動,行為不變;但偵測不再是死碼。
|
||||
|
||||
---
|
||||
|
||||
## [0.1.0] — TBD
|
||||
|
||||
### Added (initial release, scaffold)
|
||||
|
||||
Reference in New Issue
Block a user