diff --git a/core/block/editor/smartblock/smartblock.go b/core/block/editor/smartblock/smartblock.go index df58cfa7e..52f3b78c9 100644 --- a/core/block/editor/smartblock/smartblock.go +++ b/core/block/editor/smartblock/smartblock.go @@ -818,7 +818,9 @@ func (sb *smartBlock) setObjectTypes(s *state.State, objectTypes []string) (err ot := otypes[len(otypes)-1] s.SetObjectTypes(objectTypes) - s.SetDetailAndBundledRelation(bundle.RelationKeyLayout, pbtypes.Float64(float64(ot.Layout))) + if pbtypes.Get(s.Details(), bundle.RelationKeyLayout.String()) == nil { + s.SetDetailAndBundledRelation(bundle.RelationKeyLayout, pbtypes.Float64(float64(ot.Layout))) + } return } diff --git a/util/builtintemplate/builtintemplate_test.go b/util/builtintemplate/builtintemplate_test.go index ccab38eed..0c149817a 100644 --- a/util/builtintemplate/builtintemplate_test.go +++ b/util/builtintemplate/builtintemplate_test.go @@ -4,9 +4,7 @@ import ( "testing" "github.com/anytypeio/go-anytype-middleware/app/testapp" - "github.com/anytypeio/go-anytype-middleware/core/block/editor/state" "github.com/anytypeio/go-anytype-middleware/core/block/source" - "github.com/anytypeio/go-anytype-middleware/pkg/lib/pb/model" "github.com/anytypeio/go-anytype-middleware/util/testMock/mockSource" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" @@ -18,9 +16,7 @@ func Test_registerBuiltin(t *testing.T) { s := mockSource.NewMockService(ctrl) s.EXPECT().Name().Return(source.CName).AnyTimes() s.EXPECT().Init(gomock.Any()).AnyTimes() - s.EXPECT().NewStaticSource(gomock.Any(), gomock.Any(), gomock.Any()).Do(func(id string, sbt model.SmartBlockType, s *state.State) { - t.Log(s.StringDebug()) - }).AnyTimes() + s.EXPECT().NewStaticSource(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes() s.EXPECT().RegisterStaticSource(gomock.Any(), gomock.Any()).AnyTimes() a := testapp.New().With(s).With(New()) diff --git a/util/builtintemplate/data/bundled_templates.zip b/util/builtintemplate/data/bundled_templates.zip index 475579232..76f54039e 100644 Binary files a/util/builtintemplate/data/bundled_templates.zip and b/util/builtintemplate/data/bundled_templates.zip differ