From bd96fae14bc6201cb6e81b1cb2c51b00314810b6 Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Wed, 14 Dec 2016 09:07:50 -0800 Subject: maintain original slug and append to it with single incremental value, not many --- system/db/content.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'system') diff --git a/system/db/content.go b/system/db/content.go index 52fc8d5..0661556 100644 --- a/system/db/content.go +++ b/system/db/content.go @@ -494,6 +494,7 @@ func checkSlugForDuplicate(slug string) (string, error) { // check for existing slug in __contentIndex err := store.View(func(tx *bolt.Tx) error { b := tx.Bucket([]byte("__contentIndex")) + original := slug exists := true i := 0 for exists { @@ -504,7 +505,7 @@ func checkSlugForDuplicate(slug string) (string, error) { } i++ - slug = fmt.Sprintf("%s-%d", slug, i) + slug = fmt.Sprintf("%s-%d", original, i) } return nil -- cgit v1.2.3