summaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
Diffstat (limited to 'system')
-rw-r--r--system/admin/handlers.go5
-rw-r--r--system/api/create.go5
-rw-r--r--system/api/update.go5
-rw-r--r--system/db/config.go5
4 files changed, 12 insertions, 8 deletions
diff --git a/system/admin/handlers.go b/system/admin/handlers.go
index 3933d3d..0700003 100644
--- a/system/admin/handlers.go
+++ b/system/admin/handlers.go
@@ -1851,7 +1851,6 @@ func editHandler(res http.ResponseWriter, req *http.Request) {
// and correctly format for db storage. Essentially, we need
// fieldX.0: value1, fieldX.1: value2 => fieldX: []string{value1, value2}
fieldOrderValue := make(map[string]map[string][]string)
- ordVal := make(map[string][]string)
for k, v := range req.PostForm {
if strings.Contains(k, ".") {
fo := strings.Split(k, ".")
@@ -1859,7 +1858,9 @@ func editHandler(res http.ResponseWriter, req *http.Request) {
// put the order and the field value into map
field := string(fo[0])
order := string(fo[1])
- fieldOrderValue[field] = ordVal
+ if len(fieldOrderValue[field]) == 0 {
+ fieldOrderValue[field] = make(map[string][]string)
+ }
// orderValue is 0:[?type=Thing&id=1]
orderValue := fieldOrderValue[field]
diff --git a/system/api/create.go b/system/api/create.go
index 3b748cc..8af415b 100644
--- a/system/api/create.go
+++ b/system/api/create.go
@@ -83,7 +83,6 @@ func createContentHandler(res http.ResponseWriter, req *http.Request) {
// and correctly format for db storage. Essentially, we need
// fieldX.0: value1, fieldX.1: value2 => fieldX: []string{value1, value2}
fieldOrderValue := make(map[string]map[string][]string)
- ordVal := make(map[string][]string)
for k, v := range req.PostForm {
if strings.Contains(k, ".") {
fo := strings.Split(k, ".")
@@ -91,7 +90,9 @@ func createContentHandler(res http.ResponseWriter, req *http.Request) {
// put the order and the field value into map
field := string(fo[0])
order := string(fo[1])
- fieldOrderValue[field] = ordVal
+ if len(fieldOrderValue[field]) == 0 {
+ fieldOrderValue[field] = make(map[string][]string)
+ }
// orderValue is 0:[?type=Thing&id=1]
orderValue := fieldOrderValue[field]
diff --git a/system/api/update.go b/system/api/update.go
index 36ffaeb..31f29c1 100644
--- a/system/api/update.go
+++ b/system/api/update.go
@@ -84,7 +84,6 @@ func updateContentHandler(res http.ResponseWriter, req *http.Request) {
// and correctly format for db storage. Essentially, we need
// fieldX.0: value1, fieldX.1: value2 => fieldX: []string{value1, value2}
fieldOrderValue := make(map[string]map[string][]string)
- ordVal := make(map[string][]string)
for k, v := range req.PostForm {
if strings.Contains(k, ".") {
fo := strings.Split(k, ".")
@@ -92,7 +91,9 @@ func updateContentHandler(res http.ResponseWriter, req *http.Request) {
// put the order and the field value into map
field := string(fo[0])
order := string(fo[1])
- fieldOrderValue[field] = ordVal
+ if len(fieldOrderValue[field]) == 0 {
+ fieldOrderValue[field] = make(map[string][]string)
+ }
// orderValue is 0:[?type=Thing&id=1]
orderValue := fieldOrderValue[field]
diff --git a/system/db/config.go b/system/db/config.go
index 5bb010a..c67fbe3 100644
--- a/system/db/config.go
+++ b/system/db/config.go
@@ -36,7 +36,6 @@ func SetConfig(data url.Values) error {
// and correctly format for db storage. Essentially, we need
// fieldX.0: value1, fieldX.1: value2 => fieldX: []string{value1, value2}
fieldOrderValue := make(map[string]map[string][]string)
- ordVal := make(map[string][]string)
for k, v := range data {
if strings.Contains(k, ".") {
fo := strings.Split(k, ".")
@@ -44,7 +43,9 @@ func SetConfig(data url.Values) error {
// put the order and the field value into map
field := string(fo[0])
order := string(fo[1])
- fieldOrderValue[field] = ordVal
+ if len(fieldOrderValue[field]) == 0 {
+ fieldOrderValue[field] = make(map[string][]string)
+ }
// orderValue is 0:[?type=Thing&id=1]
orderValue := fieldOrderValue[field]