summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2017-01-11 18:33:37 -0800
committerSteve Manuel <nilslice@gmail.com>2017-01-11 18:33:37 -0800
commitf65a0092d3c30880d8bf6a9e9f07573b36ee7816 (patch)
tree679a602d3b30a6c2effcf90366e79936a1dfad13
parent2e0b2d83f065d72fc39f89f592f98af421fce34a (diff)
attempting to force item.Types to be populated before the db Init step
-rw-r--r--content/doc.go4
-rw-r--r--system/addon/addon.go1
-rw-r--r--system/addon/manager.go3
-rw-r--r--system/db/addon.go3
-rw-r--r--system/db/init.go3
-rw-r--r--system/item/types.go6
6 files changed, 14 insertions, 6 deletions
diff --git a/content/doc.go b/content/doc.go
index 3e15b11..8ae4c06 100644
--- a/content/doc.go
+++ b/content/doc.go
@@ -1,6 +1,6 @@
// Package content contains all user-supplied content which the system is to
// manage. Generate content types by using the Ponzu command line tool 'ponzu'
// by running `$ ponzu generate <contentName> <fieldName:type...>`
-// Note: doc.go file is required to build the Ponzu command since main.go
-// imports content package to a blank identifier.
+// Note: doc.go file is required to build the Ponzu command since some packages
+// import content package to a blank identifier.
package content
diff --git a/system/addon/addon.go b/system/addon/addon.go
index e4e8f70..51be9dc 100644
--- a/system/addon/addon.go
+++ b/system/addon/addon.go
@@ -8,6 +8,7 @@ import (
"github.com/ponzu-cms/ponzu/system/db"
"github.com/ponzu-cms/ponzu/system/item"
+
"github.com/tidwall/sjson"
)
diff --git a/system/addon/manager.go b/system/addon/manager.go
index d73e228..d3c9673 100644
--- a/system/addon/manager.go
+++ b/system/addon/manager.go
@@ -7,8 +7,9 @@ import (
"html/template"
"net/url"
- "github.com/gorilla/schema"
"github.com/ponzu-cms/ponzu/management/editor"
+
+ "github.com/gorilla/schema"
"github.com/tidwall/gjson"
)
diff --git a/system/db/addon.go b/system/db/addon.go
index 4b3e20c..f4621fa 100644
--- a/system/db/addon.go
+++ b/system/db/addon.go
@@ -2,13 +2,12 @@ package db
import (
"bytes"
+ "encoding/json"
"errors"
"fmt"
"log"
"net/url"
- "encoding/json"
-
"github.com/boltdb/bolt"
"github.com/gorilla/schema"
)
diff --git a/system/db/init.go b/system/db/init.go
index eaf6d76..4999e1b 100644
--- a/system/db/init.go
+++ b/system/db/init.go
@@ -7,6 +7,9 @@ import (
"github.com/ponzu-cms/ponzu/system/admin/config"
"github.com/ponzu-cms/ponzu/system/item"
+ // content package must be initialized so our db is pre-configured
+ _ "github.com/ponzu-cms/ponzu/content"
+
"github.com/boltdb/bolt"
"github.com/nilslice/jwt"
)
diff --git a/system/item/types.go b/system/item/types.go
index b796309..bcae58a 100644
--- a/system/item/types.go
+++ b/system/item/types.go
@@ -28,5 +28,9 @@ var (
// Types is a map used to reference a type name to its actual Editable type
// mainly for lookups in /admin route based utilities
- Types = make(map[string]func() interface{})
+ Types map[string]func() interface{}
)
+
+func init() {
+ Types = make(map[string]func() interface{})
+}