Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] User management can't filter by role #409

Closed
pobyzaarif opened this issue Feb 11, 2021 · 2 comments
Closed

[BUG] User management can't filter by role #409

pobyzaarif opened this issue Feb 11, 2021 · 2 comments
Labels
🐛bug Something isn't working

Comments

@pobyzaarif
Copy link

pobyzaarif commented Feb 11, 2021

Bug Description [describe the bug in detail]

Something wrong when i try to filter user by role in goadmin user management page.
I thought its only on my own machine, maybe i made mistake when i write some custom codes there.
But its also happen in fresh install go admin.

Error 1054: Unknown column 'goadmin_roles.name' in 'where clause' error

2021-02-12T00:49:28.145+0700	ERROR	controller/handler.go:31	Error 1054: Unknown column 'goadmin_roles.name' in 'where clause'
github.com/GoAdminGroup/go-admin/modules/logger.Error
	/Users/poby/project/Go/pkg/mod/github.com/!go!admin!group/[email protected]/modules/logger/logger.go:285
github.com/GoAdminGroup/go-admin/plugins/admin/controller.(*Handler).GlobalDeferHandler
	/Users/poby/project/Go/pkg/mod/github.com/!go!admin!group/[email protected]/plugins/admin/controller/handler.go:31
runtime.gopanic
	/usr/local/opt/go/libexec/src/runtime/panic.go:679
github.com/GoAdminGroup/go-admin/modules/db.CommonQuery
	/Users/poby/project/Go/pkg/mod/github.com/!go!admin!group/[email protected]/modules/db/performer.go:20
github.com/GoAdminGroup/go-admin/modules/db.(*Mysql).QueryWithConnection
	/Users/poby/project/Go/pkg/mod/github.com/!go!admin!group/[email protected]/modules/db/mysql.go:83
github.com/GoAdminGroup/go-admin/plugins/admin/modules/table.(*DefaultTable).getDataFromDatabase
	/Users/poby/project/Go/pkg/mod/github.com/!go!admin!group/[email protected]/plugins/admin/modules/table/default.go:570
github.com/GoAdminGroup/go-admin/plugins/admin/modules/table.(*DefaultTable).GetData
	/Users/poby/project/Go/pkg/mod/github.com/!go!admin!group/[email protected]/plugins/admin/modules/table/default.go:135
github.com/GoAdminGroup/go-admin/plugins/admin/controller.(*Handler).showTableData
	/Users/poby/project/Go/pkg/mod/github.com/!go!admin!group/[email protected]/plugins/admin/controller/show.go:70
github.com/GoAdminGroup/go-admin/plugins/admin/controller.(*Handler).showTable
	/Users/poby/project/Go/pkg/mod/github.com/!go!admin!group/[email protected]/plugins/admin/controller/show.go:102
github.com/GoAdminGroup/go-admin/plugins/admin/controller.(*Handler).ShowInfo
	/Users/poby/project/Go/pkg/mod/github.com/!go!admin!group/[email protected]/plugins/admin/controller/show.go:60
github.com/GoAdminGroup/go-admin/context.(*Context).Next
	/Users/poby/project/Go/pkg/mod/github.com/!go!admin!group/[email protected]/context/context.go:101
github.com/GoAdminGroup/go-admin/plugins/admin/modules/guard.(*Guard).CheckPrefix
	/Users/poby/project/Go/pkg/mod/github.com/!go!admin!group/[email protected]/plugins/admin/modules/guard/guard.go:51
github.com/GoAdminGroup/go-admin/context.(*Context).Next
	/Users/poby/project/Go/pkg/mod/github.com/!go!admin!group/[email protected]/context/context.go:101
github.com/GoAdminGroup/go-admin/modules/auth.(*Invoker).Middleware.func1
	/Users/poby/project/Go/pkg/mod/github.com/!go!admin!group/[email protected]/modules/auth/middleware.go:132
github.com/GoAdminGroup/go-admin/context.(*Context).Next
	/Users/poby/project/Go/pkg/mod/github.com/!go!admin!group/[email protected]/context/context.go:101
github.com/GoAdminGroup/go-admin/plugins/admin.(*Admin).globalErrorHandler
	/Users/poby/project/Go/pkg/mod/github.com/!go!admin!group/[email protected]/plugins/admin/router.go:106
github.com/GoAdminGroup/go-admin/context.(*Context).Next
	/Users/poby/project/Go/pkg/mod/github.com/!go!admin!group/[email protected]/context/context.go:101
github.com/GoAdminGroup/go-admin/adapter/gin.(*Gin).AddHandler.func1
	/Users/poby/project/Go/pkg/mod/github.com/!go!admin!group/[email protected]/adapter/gin/gin.go:91
github.com/gin-gonic/gin.(*Context).Next
	/Users/poby/project/Go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:161
github.com/gin-gonic/gin.RecoveryWithWriter.func1
	/Users/poby/project/Go/pkg/mod/github.com/gin-gonic/[email protected]/recovery.go:83
github.com/gin-gonic/gin.(*Context).Next
	/Users/poby/project/Go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:161
github.com/gin-gonic/gin.LoggerWithConfig.func1
	/Users/poby/project/Go/pkg/mod/github.com/gin-gonic/[email protected]/logger.go:241
github.com/gin-gonic/gin.(*Context).Next
	/Users/poby/project/Go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:161
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/Users/poby/project/Go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:409
github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/Users/poby/project/Go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:367
net/http.serverHandler.ServeHTTP
	/usr/local/opt/go/libexec/src/net/http/server.go:2802
net/http.(*conn).serve
	/usr/local/opt/go/libexec/src/net/http/server.go:1890

How to reproduce

  • login goadmin
  • go to Admin > Users > Filter
  • Fill Role form with value

or you can open this goadmin demo

Expect

user can filtered by role

Versions

  • GoAdmin version: v1.2.19
  • Golang version: go1.13
  • Build : goadmin + mysql + echo
@pobyzaarif pobyzaarif added the 🐛bug Something isn't working label Feb 11, 2021
@chenhg5
Copy link
Collaborator

chenhg5 commented Feb 21, 2021

@pobyzaarif Fixed it in the latest commit. A new version will be published tonight.

@chenhg5 chenhg5 closed this as completed Feb 21, 2021
@pobyzaarif
Copy link
Author

thank you @chenhg5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants