mirror of
https://github.com/openwrt/luci.git
synced 2026-10-14 17:47:10 +04:00
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>