diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d1c12ae38..6a2f364761 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [unreleased] + +### Fixed +- Fix generate associated item massive action + ## [2.12.6] - 2026-02-23 +### Fixed + - Fix SQL query error when displaying deliveries - Fix error during generate associated material action - Fix SQL warning during installation diff --git a/inc/link.class.php b/inc/link.class.php index a7b7953b1e..8af76df2a8 100644 --- a/inc/link.class.php +++ b/inc/link.class.php @@ -135,24 +135,26 @@ public function showItemGenerationForm($params) $row['otherserial'] = $item->fields["otherserial"] ?? ""; $row['states_id'] = $item->fields["states_id"] ?? ""; $row['locations_id'] = $item->fields["locations_id"] ?? ""; - $row['groups_id'] = $item->fields["groups_id"] ?? []; + $row['groups_id'] = $item->fields["groups_id"] ?? 0; $row['immo_number'] = $item->fields["immo_number"] ?? ""; $row['template_name'] = $reference->getTemplateName($itemtype, $templateID); - - if (Toolbox::hasTrait($itemtype, AssignableItem::class)) { - $row['assignableitem'] = true; - } - } else { $row['name'] = false; $row['otherserial'] = false; $row['states_id'] = false; $row['locations_id'] = false; - $row['groups_id'] = []; + $row['groups_id'] = 0; $row['immo_number'] = false; $row['template_name'] = ""; } + if (Toolbox::hasTrait($itemtype, AssignableItem::class)) { + $row['assignableitem'] = true; + if (!is_array($row['groups_id'])) { + $row['groups_id'] = $row['groups_id'] > 0 ? [$row['groups_id']] : []; + } + } + $item_rows[] = $row; $found = true; }