Ghost/core/test/unit/models
Katharina Irrgang 04c60b4ce1
🐛 Fixed private blogging getting enabled when saving any setting (#10576)
no issue

- Reported here: https://forum.ghost.org/t/in-version-2-16-3-found-bug/6065/3

---

Admin Client sends false or true booleans for `is_private` key.

The settings table has two columns "key" and "value". And "value" is always type TEXT.

If you pass value=false, the db will transform this value into "0".
`settingsCache.get('is_private')` is then always true, even though the value is meant to be false.

We should add a migration in v3 and normalize all setting values to ensure consistent database values. Furthermore, we should improve the handling around settings values in general.

For now, we protect parsing values from DB, which we anyway need to transform the values into the correct data type, because we always save strings. This will protect values being stored as "false" or "1" or whatever.
2019-03-06 12:56:26 +01:00
..
base Separated pages & posts in Admin API v2 (#10494) 2019-02-22 10:17:14 +07:00
plugins Bumped sinon from 4.4.6 to 7.3.2 (#10400) 2019-01-21 17:53:44 +01:00
api-key_spec.js Shortened admin key length (#10418) 2019-01-24 13:46:33 +00:00
invite_spec.js Removed unit tests who use the database (#10407) 2019-01-22 13:36:30 +01:00
permission_spec.js Removed unit tests who use the database (#10407) 2019-01-22 13:36:30 +01:00
post_spec.js Removed unit tests who use the database (#10407) 2019-01-22 13:36:30 +01:00
session_spec.js Bumped sinon from 4.4.6 to 7.3.2 (#10400) 2019-01-21 17:53:44 +01:00
settings_spec.js 🐛 Fixed private blogging getting enabled when saving any setting (#10576) 2019-03-06 12:56:26 +01:00
tag_spec.js Removed unit tests who use the database (#10407) 2019-01-22 13:36:30 +01:00
user_spec.js Removed unit tests who use the database (#10407) 2019-01-22 13:36:30 +01:00