Frank Vèssia Posted October 30, 2011 Share Posted October 30, 2011 Ryan, referring to your example in new user system i'm trying to get some users using this code: $role = wire('roles')->get("superuser"); $users = wire('users')->find("role=$role,sort=name"); but i get this strange error: ProcessWire Error:Exception: Field does not exist: role (in /home/videog/public_html/wire/core/PageFinder.php line 244) Link to comment Share on other sites More sharing options...
ryan Posted October 30, 2011 Share Posted October 30, 2011 It's a typo, where did you find it? I'd like to correct it. It should be: $users = wire('users')->find("roles=$role,sort=name"); Note "roles=" (plural) above, not "role=". There is no built-in field called "role" in ProcessWire so the error message you got is correct that the field does not exist. Link to comment Share on other sites More sharing options...
Frank Vèssia Posted October 31, 2011 Author Share Posted October 31, 2011 i copied from here: http://processwire.com/talk/index.php/topic,229.0.html The wrong code appears two times before the screenshots. Link to comment Share on other sites More sharing options...
ryan Posted October 31, 2011 Share Posted October 31, 2011 Thanks, I've fixed that. That particular post was written before the new user system was, so those code examples were approximations but still want to keep them correct. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now