Compare commits

..

No commits in common. "71d2a6a41a7fea7a71efa125f47567b5cb5ba56a" and "050c38ca19cce06040741321e7871121981c76f4" have entirely different histories.

6 changed files with 9 additions and 14 deletions

View File

@ -88,7 +88,7 @@ func main() {
} }
func runEnvironmentToIni(c *cli.Context) error { func runEnvironmentToIni(c *cli.Context) error {
setting.InitWorkPathAndCfgProvider(os.Getenv, setting.ArgWorkPathAndCustomConf{ setting.InitWorkPathAndCommonConfig(os.Getenv, setting.ArgWorkPathAndCustomConf{
WorkPath: c.String("work-path"), WorkPath: c.String("work-path"),
CustomPath: c.String("custom-path"), CustomPath: c.String("custom-path"),
CustomConf: c.String("config"), CustomConf: c.String("config"),

2
go.mod
View File

@ -122,7 +122,7 @@ require (
mvdan.cc/xurls/v2 v2.4.0 mvdan.cc/xurls/v2 v2.4.0
strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251 strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251
xorm.io/builder v0.3.12 xorm.io/builder v0.3.12
xorm.io/xorm v1.3.3-0.20230623150031-18f8e7a86c75 xorm.io/xorm v1.3.3-0.20230219231735-056cecc97e9e
) )
require ( require (

4
go.sum
View File

@ -1923,5 +1923,5 @@ strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251/go.mod h1:
xorm.io/builder v0.3.11-0.20220531020008-1bd24a7dc978/go.mod h1:aUW0S9eb9VCaPohFCH3j7czOx1PMW3i1HrSzbLYGBSE= xorm.io/builder v0.3.11-0.20220531020008-1bd24a7dc978/go.mod h1:aUW0S9eb9VCaPohFCH3j7czOx1PMW3i1HrSzbLYGBSE=
xorm.io/builder v0.3.12 h1:ASZYX7fQmy+o8UJdhlLHSW57JDOkM8DNhcAF5d0LiJM= xorm.io/builder v0.3.12 h1:ASZYX7fQmy+o8UJdhlLHSW57JDOkM8DNhcAF5d0LiJM=
xorm.io/builder v0.3.12/go.mod h1:aUW0S9eb9VCaPohFCH3j7czOx1PMW3i1HrSzbLYGBSE= xorm.io/builder v0.3.12/go.mod h1:aUW0S9eb9VCaPohFCH3j7czOx1PMW3i1HrSzbLYGBSE=
xorm.io/xorm v1.3.3-0.20230623150031-18f8e7a86c75 h1:ReBAlO50dCIXCWF8Gbi0ZRa62AGAwCJNCPaUNUa7JSg= xorm.io/xorm v1.3.3-0.20230219231735-056cecc97e9e h1:d5PY6mwuQK5/7T6VKfFswaKMzLmGTHkJ/ZS7+cUIAjk=
xorm.io/xorm v1.3.3-0.20230623150031-18f8e7a86c75/go.mod h1:9NbjqdnjX6eyjRRhh01GHm64r6N9shTb/8Ak3YRt8Nw= xorm.io/xorm v1.3.3-0.20230219231735-056cecc97e9e/go.mod h1:9NbjqdnjX6eyjRRhh01GHm64r6N9shTb/8Ak3YRt8Nw=

View File

@ -123,10 +123,7 @@ func newXORMEngine() (*xorm.Engine, error) {
// SyncAllTables sync the schemas of all tables, is required by unit test code // SyncAllTables sync the schemas of all tables, is required by unit test code
func SyncAllTables() error { func SyncAllTables() error {
_, err := x.StoreEngine("InnoDB").SyncWithOptions(xorm.SyncOptions{ return x.StoreEngine("InnoDB").Sync2(tables...)
WarnIfDatabaseColumnMissed: true,
}, tables...)
return err
} }
// InitEngine initializes the xorm.Engine and sets it as db.DefaultContext // InitEngine initializes the xorm.Engine and sets it as db.DefaultContext

View File

@ -89,12 +89,6 @@ func (s *stringWithDefault) Set(v string) {
// InitWorkPathAndCommonConfig will set AppWorkPath, CustomPath and CustomConf, init default config provider by CustomConf and load common settings, // InitWorkPathAndCommonConfig will set AppWorkPath, CustomPath and CustomConf, init default config provider by CustomConf and load common settings,
func InitWorkPathAndCommonConfig(getEnvFn func(name string) string, args ArgWorkPathAndCustomConf) { func InitWorkPathAndCommonConfig(getEnvFn func(name string) string, args ArgWorkPathAndCustomConf) {
InitWorkPathAndCfgProvider(getEnvFn, args)
LoadCommonSettings()
}
// InitWorkPathAndCfgProvider will set AppWorkPath, CustomPath and CustomConf, init default config provider by CustomConf
func InitWorkPathAndCfgProvider(getEnvFn func(name string) string, args ArgWorkPathAndCustomConf) {
tryAbsPath := func(paths ...string) string { tryAbsPath := func(paths ...string) string {
s := paths[len(paths)-1] s := paths[len(paths)-1]
for i := len(paths) - 2; i >= 0; i-- { for i := len(paths) - 2; i >= 0; i-- {
@ -192,4 +186,6 @@ func InitWorkPathAndCfgProvider(getEnvFn func(name string) string, args ArgWorkP
AppWorkPath = tmpWorkPath.Value AppWorkPath = tmpWorkPath.Value
CustomPath = tmpCustomPath.Value CustomPath = tmpCustomPath.Value
CustomConf = tmpCustomConf.Value CustomConf = tmpCustomConf.Value
LoadCommonSettings()
} }

View File

@ -345,6 +345,8 @@ export function initGlobalButtons() {
if (colorPickers.length > 0) { if (colorPickers.length > 0) {
initCompColorPicker(); initCompColorPicker();
} }
// all non-"ok" buttons which do not have "type" should not submit the form, should not be triggered by "Enter"
$($(this).attr('data-modal')).find('form button:not(.ok):not([type])').attr('type', 'button');
}); });
$('.delete-post.button').on('click', function (e) { $('.delete-post.button').on('click', function (e) {