Every calculated day adds a line in the asset history

Open Beginner friendly
#396 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
php
Domain
backend

Research direction

The issue names CarbonEmission and AbstractImpact and reports that both inherit CommonDBChild without overriding $logs_for_parent. Read those class definitions and check how the parent class handles this property. Done means calculated rows no longer add entries to the asset history while calculations continue unchanged.

Written by the indexing model from the issue text.

Description

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

Dominant language
PHP
Stars
5
Forks
7
Avg merge
2h 26m
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pluginsGLPI/carbon

All issues in pluginsGLPI/carbon

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.