I have had a custom console command running fine for several months now which sent out reminder emails to users when there accounts are about to expire.
After the latest Craft update (I believe) it stopped working. Here is the error:
CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'users.locked' in 'field list' exception 'CDbException' with message 'CDbCommand failed to execute the SQL statement:SQLSTATE[42S22]: Column not found: 1054 Unknown column 'users.locked' in 'field list'' in CDbCommand.php:543
The lines of code from the plugin service which cause the error are:
$user_criteria = craft()->elements->getCriteria(ElementType::User); $user_criteria->userExpiryDate = date('Y-m-d',strtotime("+7 days")); $users = $user_criteria->find();
Basically it fails when running the find() method.
Strangely I haven't managed to replicate the error on my local machine.
Does anyone have any idea what might be causing this?