From f1fbb98acd3007586f533d1c2581cfa31f7c2ccc Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 20 Apr 2025 18:55:35 +0200 Subject: [PATCH] Fix api_setup.class.php (#33930) --- htdocs/api/class/api_setup.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index f888c5a1efe..6636f7b82b1 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -85,8 +85,9 @@ class Setup extends DolibarrApi $sql = "SELECT t.rowid as id, t.elementtype, t.code, t.contexts, t.label, t.description, t.rang"; $sql .= " FROM ".MAIN_DB_PREFIX."c_action_trigger as t"; + $sql .= " WHERE 1=1"; if (!empty($elementtype)) { - $sql .= " WHERE t.elementtype = '".$this->db->escape($elementtype)."'"; + $sql .= " AND t.elementtype = '".$this->db->escape($elementtype)."'"; } // Add sql filters if ($sqlfilters) {