diff --git a/captcha.inc b/captcha.inc index 86b6a00..f19cef4 100644 --- a/captcha.inc +++ b/captcha.inc @@ -109,7 +109,7 @@ function _captcha_generate_captcha_session($form_id=NULL, $status=CAPTCHA_STATUS // Insert an entry and thankfully receive the value of the autoincrement field 'csid'. $captcha_sid = db_insert('captcha_sessions') ->fields(array( - 'uid' => $user->uid, + 'uid' => $user->id(), 'sid' => session_id(), 'ip_address' => Drupal::request()->getClientIp(), 'timestamp' => REQUEST_TIME, diff --git a/image_captcha/image_captcha.module b/image_captcha/image_captcha.module index d16e5a4..7ff445c 100644 --- a/image_captcha/image_captcha.module +++ b/image_captcha/image_captcha.module @@ -232,7 +232,7 @@ function image_captcha_captcha($op, $captcha_type='', $captcha_sid=NULL) { // for the image itself won't succeed (only ?q=user is permitted for // unauthenticated users). We fall back to the Math CAPTCHA in that case. global $user; - if (variable_get('maintenance_mode', 0) && $user->uid == 0) { + if (variable_get('maintenance_mode', 0) && $user->id() == 0) { return captcha_captcha('generate', 'Math'); } // generate a CAPTCHA code