From c30225f223df8353319e6d171b53fc1a41647538 Mon Sep 17 00:00:00 2001 From: Selt <83926739+seltonmt012@users.noreply.github.com> Date: Mon, 27 Jul 2026 02:05:17 +0200 Subject: [PATCH] fix(es_extended/server/functions): persist items added via AddItems MySQL.prepare.await batch mode expects an array of positional parameter arrays, but toInsert holds keyed tables, so the placeholders received no values and the INSERT silently did nothing. Items still showed up in-game because ESX.Items was populated from the keyed tables, but nothing was written to the items table. Build a positional parameters array for the prepared insert. Closes #1768 --- [core]/es_extended/server/functions.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/[core]/es_extended/server/functions.lua b/[core]/es_extended/server/functions.lua index 7ab5f9b4..089f016a 100644 --- a/[core]/es_extended/server/functions.lua +++ b/[core]/es_extended/server/functions.lua @@ -799,9 +799,15 @@ if not Config.CustomInventory then end if #toInsert > 0 then + local parameters = {} + for i = 1, #toInsert do + local row = toInsert[i] + parameters[i] = { row.name, row.label, row.weight, row.rare, row.canRemove } + end + MySQL.prepare.await( "INSERT IGNORE INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES (?, ?, ?, ?, ?)", - toInsert) + parameters) for i = 1, #toInsert do local row = toInsert[i]