Hi, we have some softwares that is installed once in a unique machine, so just have one version of this software. If I force a syncronization the follow part of code DELETE complete the software and all information registred in it is lost, including license, management information, etc.
software.class.php: line 510
if ($DB->result($result2, 0, 0) == 1) {
$vers = new SoftwareVersion();
$vers->getFromDB($data['softwareversions_id']);
$query3 = "SELECT COUNT(*)
FROM `glpi_softwareversions`
WHERE `softwares_id`= " . $vers->fields['softwares_id'];
$result3 = $DB->query($query3);
if ($DB->result($result3, 0, 0) == 1) {
$soft = new Software();
$soft->delete(['id' => $vers->fields['softwares_id'],
'_no_history' => !$uninstall_history],
true,
$uninstall_history);
}
$vers->delete(["id" => $data['softwareversions_id'],
'_no_history' => !$uninstall_history],
true,
$uninstall_history);
}
Special this code:
if ($DB->result($result3, 0, 0) == 1) {
$soft = new Software();
$soft->delete(['id' => $vers->fields['softwares_id'],
'_no_history' => !$uninstall_history],
true,
$uninstall_history);
}
Why delete THE SOFTWARE, I understand the force delete all link between computer and software, but the software should be deleted?
I think the fixes made by @tsmr apply to the GLPI10 beta. I applied the above changes to GLPI9.5.7 and the ocsinventoryng plugin stopped synchronizing with ocs server.
-OCS version: 2.9.2 -GLPI version: 9.5.7
Hi, we have some softwares that is installed once in a unique machine, so just have one version of this software. If I force a syncronization the follow part of code DELETE complete the software and all information registred in it is lost, including license, management information, etc.
software.class.php: line 510
Special this code:
Why delete THE SOFTWARE, I understand the force delete all link between computer and software, but the software should be deleted?