* Notice: Undefined variable: user_role_alias in user_build_filter_query() (line 3206 of F:\xampplite\htdocs\drupal7\modules\user\user.module).
* PDOException: 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 '= '3')' at line 2: SELECT COUNT(u.uid) AS expression FROM {users} u INNER JOIN {users_roles} ur ON ur.uid = u.uid WHERE (u.uid <> :db_condition_placeholder_0) AND (.rid = :db_condition_placeholder_1) ; Array ( [:db_condition_placeholder_0] => 0 [:db_condition_placeholder_1] => 3 ) in PagerDefault->execute() (line 86 of F:\xampplite\htdocs\drupal7\includes\pager.inc).
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 870196.patch | 3.28 KB | ericduran |
| #6 | user-admin-filter-870196.patch | 1.85 KB | mitchmac |
| #1 | drupal_870196.patch | 708 bytes | tobiasb |
Comments
Comment #1
tobiasbComment #2
Stevel commentedCould you describe the steps I need to take to reproduce this bug? That helps a lot for testing the patch.
Comment #3
damien tournoud commentedThe name of the table is 'users_roles', so the name of the variable should be $users_roles_alias.
Also, this needs tests.
Comment #4
damien tournoud commentedComment #5
tobiasb@Stevel sure. go to people (admin/people), then filter by role (administrator).
Comment #6
mitchmac commentedTweak per #3 and test.
Comment #7
infojunkieReviewed and applied patch #6: success. Also undid patch for user.module and applied new test: failure.
Comment #8
dries commentedI think this looks good but ideally, UserAdminTestCase would be refactored a bit. This patch sort of slaps a test case onto the existing class without looking at what is there. I think UserAdminTestCase could be tidied up a little.
Comment #9
webchickHm. Yeah, it looks like testUserAdmin() does at least partial testing of this admin page, so this test could likely go into there with the rest.
Dries, was there some specific refactoring you were looking for? Or just unifying the related test cases into one function?
Comment #10
ericduran commentedI change user_role_alias to users_role_alias in both case not just the elseif. I also implement the role testing in the testUserAdmin function.
Comment #11
moshe weitzman commentedhopefully this is what dries had in mind. its fixed, and its a critical.
Comment #12
webchickYeah, this looks good to me apart from some minor formatting things. I took care of those before commit.
Committed to HEAD. Great work! :)