phemellc / yii2-settings

Yii2 Settings Module
Other
151 stars 74 forks source link

fix saving empty string #77

Open shadik42 opened 6 years ago

shadik42 commented 6 years ago

Pull request for issue https://github.com/phemellc/yii2-settings/issues/75

zhukovsergei commented 6 years ago

What's about to save a zero 0? It's rather common case of setting. It will not pass throw empty()

shadik42 commented 6 years ago

Correct, and if zero provided as string value this code just skip trying of json_decode value. After that the value is saved as a string.

schmunk42 commented 6 years ago

But is 0 currently saved a object?

shadik42 commented 6 years ago

No, 0 saved with string type