We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c4e25f0 commit c029df8Copy full SHA for c029df8
settings.go
@@ -296,6 +296,21 @@ func (ss *UserSettings) Scan(v interface{}) error {
296
}
297
298
299
+// This exists as a work-around because a migration set this column wrong >_<
300
+//
301
+// https://github.com/arp242/goatcounter/issues/569#issuecomment-1042013488
302
+func (w *Widgets) UnmarshalJSON(d []byte) error {
303
+ type alias Widgets
304
+ ww := alias(*w)
305
+ err := json.Unmarshal(d, &ww)
306
+ *w = Widgets(ww)
307
+
308
+ if err != nil {
309
+ *w = defaultWidgets(context.Background())
310
+ }
311
+ return nil
312
+}
313
314
func (ss *SiteSettings) Defaults(ctx context.Context) {
315
if ss.Campaigns == nil {
316
ss.Campaigns = []string{"utm_campaign", "utm_source", "ref"}
0 commit comments