Ticket #1833 (closed enhancement: fixed)
Add setting/fav type "object"/"json"
| Reported by: | bruno | Owned by: | team |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.9 |
| Component: | module:core | Version: | 2.5 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
dcSettings currently support the settings types "boolean","integer","float" and "string".
Some more complex settings are currently playing around to fit in a string setting, using serialize and base64 stuff, leading to ticket #1249 ("save kittens, avoid serialize") for example.
A proper way to circumvent that would be to implement native "object" type into settings/favorites, or even "json" or "array" type that would be even safer.
From the compatiblity point of view, no impact for this new parameter type, old-style parameters using serialize/base64 are not affected since they will continue to use string settings.
Change History
comment:2 Changed 12 years ago by bruno
Should be applied to workspaces as well...
will severely contribute to resolution of #1249
comment:4 Changed 10 years ago by franck <carnet.franck.paul@…>
- Status changed from new to closed
- Resolution set to fixed
(In [568e0d0e0991]) Add new array type for settings and prefs, closes #1833 (thank's Dsls for code)
comment:5 Changed 10 years ago by franck <carnet.franck.paul@…>
(In [a7553434ee4c]) Use new setting type 'array' for some settings, addresses #1833
comment:6 Changed 10 years ago by franck <carnet.franck.paul@…>
(In [80348e1ba097]) Update about:config plugin to cope with array settings, addresses #1833
comment:7 Changed 10 years ago by franck <carnet.franck.paul@…>
(In [468195e4ad8b]) Use new pref type 'array' for some prefs, addresses #1833
comment:8 Changed 10 years ago by franck
Au passage le plugin errorLogger aura besoin d'une petite mise à jour pour la 2.9
Dans class.errorlogger.php, lignes 37,38 :
$date_formats = @unserialize($core->blog->settings->system->date_formats); $time_formats = @unserialize($core->blog->settings->system->time_formats);
à remplacer par :
$date_formats = $core->blog->settings->system->date_formats; $time_formats = $core->blog->settings->system->time_formats;
Et tant qu'à modifier, autant faire plus simple, remplacer les lignes 37, 37 et 39 par :
$this->ts_format = '%Y-%m-%d %H:%M:%S';
Suffira amplement.

1st experiments here : https://bitbucket.org/dsls/dotclear/commits/645cfd9298e8ba3db5fcd357933b2cd6ea47ed09
candidate settings : date_formats and time_formats