[Issue A] save_thing_end 脏数据写回导致幽灵 spec #15
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
概述
save_thing_end 时机优先读 DB 旧数据,前端过滤后的数据只是 fallback。脏 config 块(template_id 指向已硬删除的场馆)被写回 DB,导致幽灵 spec 累积。
根因
AdminGoodsSaveHandle.php 第 60-65 行:
DB 值优先,fallback 才是前端已过滤值。但 DB 值本身已含脏 config。
数据流
修复方案
修改 1(主要修复):调换读取优先级
AdminGoodsSaveHandle.php 第 60-65 行:
data 优先,DB 值兜底
修改 2(防御层):无效 config 块移除
第 88-89 行:continue → unset(configs[i])
第 145 行后:array_values 重排索引
修改 3(防御层):写回前判空
第 148-150 行前加 if (!empty(configs))
参考资料