Error Updating User (3.5 RC)

Asked by Andrew Weiner on 2014-01-11

Testing 3.5 RC. After I create a new user, I receive an error when attempting to access the user information.

The exception class is "PHPDS_databaseException" and the error code is 0. The content of the exception is as follow:
Error invoking a query of class "PAGINATION_readPaginationQuery"

SELECT SQL_CALC_FOUND_ROWS
   t1.user_id, t1.user_display_name, t1.user_name, t1.user_password, t1.user_email, t1.user_group, t1.user_role, t1.date_registered, t1.language,
   t2.user_group_name,
   t3.user_role_name
  FROM
   _db_core_users t1
  LEFT JOIN
   _db_core_user_groups t2
  ON
   t1.user_group = t2.user_group_id
  LEFT JOIN
   _db_core_user_roles t3
  ON
   t1.user_role = t3.user_role_id
   WHERE user_id != \'x\'

 LIMIT 0, 30

It appears that the user_id and proper db prefix is not being supplied to the sql query. This error also appears on pending users menu item.

Question information

Language:
English Edit question
Status:
Solved
For:
PHPDevShell Edit question
Assignee:
Greg Edit question
Solved by:
Greg
Solved:
2014-01-15
Last query:
2014-01-15
Last reply:
2014-01-14
Greg (gregfr) said : #1

I can reproduce it, I'll fix it asap

Best Greg (gregfr) said : #2

The db prefix is handled at a lower level, so the query is fine on this. The problem is that PHPDS_query changed to protect the parameters by default, and many "old" queries still do the protection themselves. To fix that, we have to disable it for each said queries:

    protected $autoProtect = false;

(or to rewrite the query in a cleaner way).

I expect a lot of that, but I really think it's for the best, since it will make the user queries simpler and therefore less error-prone.

Greg (gregfr) said : #3

Fix commited: https://bugs.launchpad.net/phpdevshell/+bug/1268890

BTW please prefer using the bug reporter for bugs :)

Thanks

Andrew Weiner (rtacorp) said : #4

Thanks Greg, that solved my question.

Andrew Weiner (rtacorp) said : #5

Thanks. In the future, I will post bugs in the bug reporter.

Greg (gregfr) said : #6

Thanks! Don't hesitate to contact us if you have any question.