ReadCollection: fix per-collection write filter typo on removeItem (#15454)

self:write({ collection_name = true }) used the literal string
"collection_name" as the table key instead of the variable's value.
write() consults the table as a per-collection allowlist
(updated_collections[coll_name]), so the gate never matched any
real collection and the per-collection saveSetting branch was
silently skipped -- the in-memory removal didn't reach disk.

Stock FM avoids the path (the collection dialog uses
addRemoveItemMultiple + full write()), so end-users have not been
impacted. Plugins calling removeItem(file, name) directly do hit
it. Fixes #15453.
This commit is contained in:
AndyHazz authored and GitHub committed 2026-05-25 11:32:14 +02:00
1 parent 59bf0ec9c2
commit f6fede38fe
1 file changed
+1 -1
+1 -1
View File
@@ -191,7 +191,7 @@ function ReadCollection:removeItem(file, collection_name, no_write) -- FM: delet
if self.coll[collection_name][file] then
self.coll[collection_name][file] = nil
if not no_write then
self:write({ collection_name = true })
self:write({ [collection_name] = true })
end
return true
end