Jump to content

[Solved] user-admin-* roles give sql error


derixithy
 Share

Recommended Posts

When i add anything below user-admin-all, like user-admin-artist, i get an 'Syntax error or access violation' error on the userlist page in the admin.

full error

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.id FROM `pages` JOIN field_roles AS field_roles1 ON field_roles1.pages_id' at line 9

No results are returned (not surprising).

below that: template=3, parent=29, include=all, limit=25, status<9999999, id!=40, roles=(roles.count=1, roles=37), roles=(roles=1018|1119), sort=name

 

I get that on any role with any custom permission.
I don't know how to track down the error.

I'm using ProcessWire 3.0.39, PHP 5.6.26 and MySQL 5.6.33

 

Solution

Do not add the roles manually!
Select the ones from the  Install predefined system permissions list.

Edited by derixithy
Solution found
Link to comment
Share on other sites

5 hours ago, derixithy said:

below that: template=3, parent=29, include=all, limit=25, status<9999999, id!=40, roles=(roles.count=1, roles=37), roles=(roles=1018|1119), sort=name

It looks like you have some filters set in the Users lister. Does the error still occur if you remove the filters?

Also, the title of your post is a little unclear - you have added "user-admin-artist" as a permission and not the name of a role, right?

Just to confirm, you followed a procedure like this...

  1. Installed user-admin permission: Access > Permissions > Add New > Install predefined system permissions > user-admin
  2. Installed user-admin-all permission: Access > Permissions > Add New > Install predefined system permissions > user-admin-all
  3. Installed user-admin-artist permission: Access > Permissions > Add New > Install predefined system permissions > user-admin-artist
  4. Gave user-admin and user-admin-artist permissions to a role: Access > Roles > artist (or whatever) > checked 'user-admin' and 'user-admin-artist'

Welcome to the forums BTW :)

Edited by Robin S
  • Like 1
Link to comment
Share on other sites

I tested with different users and different roles. The title looks correct to me because all user-admin-* roles give an error, if you know better let me know.

The roles have each an user-admin-somerolename permission added.
If i change the role to user-admin-all i get no error. if i change it to a specific role i get an sql error.

The rolenames are correct because they are found 'roles=(roles=1018|1119)' but somehow it gives an error.

Link to comment
Share on other sites

  • 3 months later...

I never got it fixed on that install, and i got it again on the latest dev version.
Now i reread it i understand what went wrong.

I added them as custom roles and did not select them from the predefined system roles list.

I deleted them and selected the build in once. The problem is fixed now.

 

Could someone tell me wat the difference is between selecting the builtin ones or create your own?

 

-edit: spelling

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...