From 44350b445b94bcad7be5885571a2d8d943bc465d Mon Sep 17 00:00:00 2001 From: RomainLvr Date: Fri, 20 Feb 2026 12:26:53 +0100 Subject: [PATCH 1/2] Fix - Use getTableForItemType() for custom dropdown search options to resolve correct shared table name --- inc/container.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/inc/container.class.php b/inc/container.class.php index 4f9f3656..12f685e9 100644 --- a/inc/container.class.php +++ b/inc/container.class.php @@ -2217,8 +2217,10 @@ public static function getAddSearchOptions($itemtype, $containers_id = false) $opt[$i]['datatype'] = 'specific'; $opt[$i]['searchtype'] = ['equals', 'notequals']; } else { - $opt[$i]['table'] = CommonDBTM::getTable($dropdown_matches['class']); - $opt[$i]['field'] = 'name'; + $opt[$i]['table'] = getTableForItemType($dropdown_matches['class']); + $opt[$i]['field'] = is_a($dropdown_matches['class'], CommonTreeDropdown::class, true) + ? 'completename' + : 'name'; $opt[$i]['right'] = 'all'; $opt[$i]['datatype'] = 'dropdown'; From c260feb36363eb65e4a6c2b22e2346aa73eb67f9 Mon Sep 17 00:00:00 2001 From: RomainLvr Date: Fri, 20 Feb 2026 12:30:56 +0100 Subject: [PATCH 2/2] Update CHANGELOG --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca4765d5..d85fa3d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ 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 SQL errors with custom dropdown fields + ## [1.23.3] - 2026-02-12 ### Added