Skip to content

Commit b89504d

Browse files
authored
Fix generateitem massive action (#560)
* Fix generate item massive action * Update changelog
1 parent bfd75a1 commit b89504d

2 files changed

Lines changed: 16 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,15 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8+
## [unreleased]
9+
10+
### Fixed
11+
- Fix generate associated item massive action
12+
813
## [2.12.6] - 2026-02-23
914

15+
### Fixed
16+
1017
- Fix SQL query error when displaying deliveries
1118
- Fix error during generate associated material action
1219
- Fix SQL warning during installation

inc/link.class.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,24 +135,26 @@ public function showItemGenerationForm($params)
135135
$row['otherserial'] = $item->fields["otherserial"] ?? "";
136136
$row['states_id'] = $item->fields["states_id"] ?? "";
137137
$row['locations_id'] = $item->fields["locations_id"] ?? "";
138-
$row['groups_id'] = $item->fields["groups_id"] ?? [];
138+
$row['groups_id'] = $item->fields["groups_id"] ?? 0;
139139
$row['immo_number'] = $item->fields["immo_number"] ?? "";
140140
$row['template_name'] = $reference->getTemplateName($itemtype, $templateID);
141-
142-
if (Toolbox::hasTrait($itemtype, AssignableItem::class)) {
143-
$row['assignableitem'] = true;
144-
}
145-
146141
} else {
147142
$row['name'] = false;
148143
$row['otherserial'] = false;
149144
$row['states_id'] = false;
150145
$row['locations_id'] = false;
151-
$row['groups_id'] = [];
146+
$row['groups_id'] = 0;
152147
$row['immo_number'] = false;
153148
$row['template_name'] = "";
154149
}
155150

151+
if (Toolbox::hasTrait($itemtype, AssignableItem::class)) {
152+
$row['assignableitem'] = true;
153+
if (!is_array($row['groups_id'])) {
154+
$row['groups_id'] = $row['groups_id'] > 0 ? [$row['groups_id']] : [];
155+
}
156+
}
157+
156158
$item_rows[] = $row;
157159
$found = true;
158160
}

0 commit comments

Comments
 (0)