Every calculated day adds a line in the asset history
还没有人认领这个 Issue。
评估
调研方向
Issue 提到了 CarbonEmission 和 AbstractImpact,并指出二者都继承 CommonDBChild,但没有重写 $logs_for_parent。阅读这些类的定义,并检查父类如何处理此属性。完成的标准是:计算出的行不再向资产历史记录添加条目,同时计算继续保持不变。
由索引模型根据 Issue 内容生成。
描述
GLPI version: 11.0.11
Plugin version: 1.3.1 (same code in 1.4.0)
Bug description
CarbonEmission and AbstractImpact extend CommonDBChild without overriding $logs_for_parent. Each row they create writes "Add an item" in the history of the asset: one line per calculated day and per asset, plus one per embodied impact.
After a few months an asset has hundreds of these lines, and a catch-up run writes thousands at once. We had 1.17 million of them. They bury the real changes, and the history is what we read to know who changed what on an asset.
Relevant log output
94342612 08-11-2026 08:58 cron_UsageImpact Emission de carbone Ajout d'un élément : Emission de carbone (N/A (1061053))
93102748 07-11-2026 08:58 cron_UsageImpact Emission de carbone Ajout d'un élément : Emission de carbone (N/A (1060639))
Anything else?
We applied public static $logs_for_parent = false; on both classes locally. Calculations are unchanged and the history stays readable.
Laurent Tison, Afnic
- 主要语言
- PHP
- 星标
- 5
- 派生
- 7
- 平均合并
- 2 小时 26 分钟
- 30 天内合并 PR
- 1
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pluginsGLPI/carbon 的其他 Issue
-
good first issue
难度 2/5 1-3 小时 新手友好度 63/100
pluginsGLPI/carbon#239 ·
-
难度 3/5 1-2 天 新手友好度 56/100
pluginsGLPI/carbon#397 ·
-
难度 3/5 1-2 天 新手友好度 70/100
pluginsGLPI/carbon#395 ·
-
难度 5/5 一周以上 新手友好度 30/100
pluginsGLPI/carbon#392 ·
-
难度 5/5 一周以上 新手友好度 25/100
pluginsGLPI/carbon#391 ·
查看 pluginsGLPI/carbon 的全部 Issue
相似的 Issue
-
[BUG] Bundle products lose their price in RSS feeds: getPrices() was removed可能已有人在做 @pcvelz 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 90/100
OpenMage/magento-lts#5869 ·
维护者通常 2 天内回复
-
难度 1/5 1-3 小时 新手友好度 85/100
modelcontextprotocol/php-sdk#746 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 90/100
OpenGIS/waymark-wp#82 ·
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
claude
难度 2/5 1-3 小时 新手友好度 76/100
sprain/sprainocchio#39 ·
维护者通常 1 天内回复