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:
1 parent
59bf0ec9c2
commit
f6fede38fe
1 file changed
+1
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user