Skip to content

Commit 8f6023c

Browse files
stonebuzzcedric-anne
authored andcommitted
Fix(Inventory): prevent lock when inventory update Item_SoftwareVersion
1 parent d4bfb58 commit 8f6023c

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

phpunit/functional/Glpi/Inventory/Assets/SoftwareTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1647,7 +1647,13 @@ public function testDateInstallUpdate()
16471647
"date_install" => "2024-03-04",
16481648
]));
16491649

1650-
//check computer-softwareverison relation is the same (ID)
1650+
//check that no lock have been added
1651+
$lock = new \Lockedfield();
1652+
$this->assertFalse($lock->getFromDBByCrit([
1653+
"itemtype" => \Item_SoftwareVersion::class,
1654+
"items_id" => $item_version->fields['id'],
1655+
"field" => "date_install",
1656+
]));
16511657
}
16521658

16531659
public function testSubCategoryDictionnary()

src/Glpi/Inventory/Asset/Software.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@ public function handle()
412412
$software_version = new Item_SoftwareVersion();
413413
$software_version->update([
414414
"id" => $db_software[$key_w_version]['id'],
415+
"is_dynamic" => 1,
415416
"date_install" => $val->date_install,
416417
], 0);
417418
}

0 commit comments

Comments
 (0)