statamic / eloquent-driver

Provides support for storing your Statamic data in a database, rather than flat files.
https://statamic.dev/tips/storing-content-in-a-database
MIT License
104 stars 72 forks source link

QueryException when filtering by User Role or Group in Statamic 4.0 #187

Closed ammonitedigital closed 1 year ago

ammonitedigital commented 1 year ago

I'm using the Eloquent Driver on Statamic 4.0 and have users stored in the database.

When trying to filter users by either role or group in the CMS, this error is shown in a toast notification:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'roles/member' in 'where clause' (SQL: select count() as aggregate from users where 'roles/member' = 1) {"userId":1,"exception":"[object] (Illuminate\Database\QueryException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'roles/member' in 'where clause' (SQL: select count() as aggregate from users where 'roles/member' = 1)

I'm aware that roles and groups are stored on the filesystem. Am I right in thinking nothing can be fixed here until this PR in Statamic is merged? https://github.com/statamic/cms/pull/5686

ryanmitchell commented 1 year ago

This issue doesn’t relate to the eloquent driver as eloquent users are handled by statamic core. Going to close this and let you reopen it there.