Fix Update source for Monitor and Peripheral#23018
Fix Update source for Monitor and Peripheral#23018Lainow wants to merge 3 commits intoglpi-project:11.0/bugfixesfrom
Conversation
| } | ||
|
|
||
| $val->is_dynamic = 1; | ||
| $val->autoupdatesystems_id = AutoUpdateSystem::NATIVE_INVENTORY; |
There was a problem hiding this comment.
I’m wondering if it might be worth applying this change in the parent class to ensure that all objects synchronized through GLPI’s native inventory have this value set.
In InventoryAsset.php:
public function __construct(CommonDBTM $item, ?array $data = null)
{
$this->item = $item;
if ($data !== null) {
$this->data = $data;
$this->data['autoupdatesystems_id'] = AutoUpdateSystem::NATIVE_INVENTORY;
}
}to ensure we never have to apply this kind of fix again.
There was a problem hiding this comment.
Yes, I guess it would be a better way to go, if that does not break. Also; the id should be properly set already on the MainAsset; it's probably better to get this one rather than hardcoding a default one.
And finally, I'm pretty sure this issue also exists on v10.
There was a problem hiding this comment.
Please don't add new entries in phpstan baseline. Either issues must be fixed (seems to be the case here) or an specific ignore comment must be added (if there is a real reason it cannot get fixed).
| } | ||
|
|
||
| $val->is_dynamic = 1; | ||
| $val->autoupdatesystems_id = AutoUpdateSystem::NATIVE_INVENTORY; |
There was a problem hiding this comment.
Yes, I guess it would be a better way to go, if that does not break. Also; the id should be properly set already on the MainAsset; it's probably better to get this one rather than hardcoding a default one.
And finally, I'm pretty sure this issue also exists on v10.
Checklist before requesting a review
Please delete options that are not relevant.
Description
Fixed the Update Source field not updating for monitors and peripherals when inventorying a computer.
Screenshots (if appropriate):