diff options
author | Steve Manuel <nilslice@gmail.com> | 2017-06-26 15:58:59 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-26 15:58:59 -0700 |
commit | 9105d78ee74858d561f7a60e36f28ed994529452 (patch) | |
tree | b0e384f7e738d3292b4d8abaa79bb25142f0e3d4 /system/api/create.go | |
parent | 5af38b7ce5b2a5c200ee528e0cb2fdbd3ca81840 (diff) | |
parent | cd6be5ebe16f3ee815e12d3022dfb79e4163d867 (diff) |
Merge pull request #171 from ponzu-cms/ponzu-dev
[core] Fixes for multi-slice content type field conflicts
Diffstat (limited to 'system/api/create.go')
-rw-r--r-- | system/api/create.go | 5 |
1 files changed, 3 insertions, 2 deletions
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] |