From cbcbe68270449e243a2628efb0945c8e1a9cd1f6 Mon Sep 17 00:00:00 2001 From: PlaneNuts <88776392+PlaneNuts@users.noreply.github.com> Date: Tue, 17 Dec 2024 08:12:09 +0100 Subject: [PATCH] Fix for Missing Dropdown Options (#448) * Fix for missing dropdown options * Update changelog * Update inc/commoninjectionlib.class.php Co-authored-by: Stanislas --------- Co-authored-by: Stanislas --- CHANGELOG.md | 1 + inc/commoninjectionlib.class.php | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c9a04c7..cfb5f87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Fix default entity insertion for a user - Fixed `SQL` error when creating new injection model +- Fixed issue with missing dropdown options ## [2.14.0] - 2024-10-10 diff --git a/inc/commoninjectionlib.class.php b/inc/commoninjectionlib.class.php index 86513b8..7fa83fa 100644 --- a/inc/commoninjectionlib.class.php +++ b/inc/commoninjectionlib.class.php @@ -2175,6 +2175,13 @@ public static function addToSearchOptions( $type_searchOptions[$id]['injectable'] = self::FIELD_INJECTABLE; } + //Some injection.class files are missing dropdown options. Set displaytype as dropdown if datatype is dropdown + //$tmp['displaytype'] is still empty. Set to prevent overwriting on next IF + if ((isset($tmp['datatype']) && $tmp['datatype'] == 'dropdown') && !isset($tmp['displaytype'])) { + $type_searchOptions[$id]['displaytype'] = 'dropdown'; + $tmp['displaytype'] = 'dropdown'; + } + if (isset($tmp['linkfield']) && !isset($tmp['displaytype'])) { $type_searchOptions[$id]['displaytype'] = 'text'; }