lunarphp / lunar

An open-source package that brings the power of modern headless e-commerce functionality to Laravel.
https://lunarphp.io
MIT License
2.71k stars 357 forks source link

ListField bug, does not allow 0 as a key #1992

Open AidasK opened 1 month ago

AidasK commented 1 month ago

Expected Behaviour:

It should be allowed to start a list with a key 0 as in regular array

Actual Behaviour:

It deletes all the values if there is a key 0 and also deletes all the duplicate fields if they have the same key.

https://github.com/user-attachments/assets/b1e4bd3c-e37c-4cf6-82b5-372225b5218c

Steps To Reproduce:

Create an attribute with ListField type and fill it with key 0