Files
luci/modules
Victor Irzak a92bec6a9b luci-base: form: don't let JSONMap add() reuse an existing section
CBIJSONConfig names anonymous sections loaded from an array
<type><n>, with n counted across all section types, while add()
names a new one <type><count of that type>. With data like
{ animals: {...}, pet: [ {...} ] } the loaded pet is "pet1" and
add() also returns "pet1", so the new entry overwrites the existing
one instead of being appended. The same happens after a remove().

Pick the first unused name instead.

Signed-off-by: Victor Irzak <victor@irzak.com>
2026-10-07 19:38:49 +02:00
..