Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Fixed

- Fix SQL errors when uninstalling or replacing peripheral assets
- Fix locales encoding

## [2.10.3] - 2025-11-25
Expand Down
7 changes: 3 additions & 4 deletions inc/replace.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -448,12 +448,11 @@ public static function replace($type, $model_id, $tab_ids, $location)
) { #do not update computer_item if no computer
$comp_item = new Asset_PeripheralAsset();
if ($olditem instanceof Computer) {
foreach (self::getAssociatedItems($olditem) as $itemtype => $connections) {
foreach (self::getAssociatedItems($olditem) as $connections) {
foreach ($connections as $connection) {
$comp_item->update(
['id' => $connection['id'],
'computers_id' => $newitem_id,
'itemtype' => $itemtype,
['id' => $connection['id'],
'items_id_asset' => $newitem_id,
],
false,
);
Expand Down
4 changes: 2 additions & 2 deletions inc/uninstall.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ private static function doOneUninstall(PluginUninstallModel $model, Transfer $tr
//------------------//
if (in_array($type, $UNINSTALL_DIRECT_CONNECTIONS_TYPE)) {
$conn = new Asset_PeripheralAsset();
$conn->deleteByCriteria(['itemtype' => $type,
'items_id' => $id,
$conn->deleteByCriteria(['itemtype_peripheral' => $type,
'items_id_peripheral' => $id,
], true);
}

Expand Down