PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table '...drupal7.aes_passwords' doesn't exist: SELECT uid, pass FROM aes_passwords WHERE uid != :uid; Array ( [:uid] => 0 ) in aes_config_submit() (line 278 of .../sites/all/modules/aes/aes.module).

the issue here is that my database table name is "...drupal7.main_aes_passwords", not "...drupal7.aes_passwords". "Main_" is my database prefix. aes_config_submit() doesn't take into account if a user has a prefix or not.

looking at the code; "SELECT ... FROM aes_passwords WHERE" is hardcoded. it should be "FROM {aes_password}" so drupal can automatically insert the prefix. i replaced 5 occurances of this on my installation of aes. just fyi.

Files: 

Comments

ledut’s picture

I update the bug priority from normal to critical because some major system features permanently and totaly fail because of this bug :
Several pages are not displayed at all, only the error warning is printed.
Drupal core failing features are :
- new user can't be create (check on : user/add)
- existing users can't be edited because the user profile page fails (check on : user/1/edit)
It affects all users, even if the "AES password" setting is disabled.
Maybe more user features could be affected (deleting users, editing multiple users).
Tested on drupal 7.7

ledut’s picture

Priority:Normal» Critical
StatusFileSize
new6.75 KB
new6.75 KB

The corrected aes.module file.

ledut’s picture

Status:Active» Needs review
StatusFileSize
new6.75 KB

Ignore previous post : this file is the one.

EvanDonovan’s picture

Title:aes database prefix» AES database queries should use {} syntax to support table prefixing.
StatusFileSize
new2.22 KB

Here's the change needed in patch form. (Zip files are not accepted as a means of communicating changes.)

EvanDonovan’s picture

Issue tags:+7.x-1.6

Tagging.

tstoeckler’s picture

Status:Needs review» Reviewed & tested by the community

Definitely RTBC.

EvanDonovan’s picture

Thanks!

EvanDonovan’s picture

Version:7.x-1.5» 7.x-1.x-dev
Status:Reviewed & tested by the community» Fixed

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 0553dee on 7.x-1.x, 8.x-2.x by EvanDonovan:
    Issue #1206698 by EvanDonovan, bogartusmaximus, tstoeckler: Database...