I repeatedly get the error “Fatal error: Call to undefined method InsertQuery_mysql::key() in /Users/kkaefer/Sites/Drupal/7/modules/user/user.module on line 1204” when trying to log in via OpenID. The query looks like this.

db_insert('authmap')->key(array(
  'uid' => $account->uid,
  'module' => $module[1],
))->fields(array(
  'authname' => $value,
))->execute();
CommentFileSizeAuthor
#3 openid_db_merge.patch1.02 KBCrell
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Crell’s picture

It looks like that should be a db_merge(). Once upon a time merge was part of insert, but was split out. Try changing db_insert() to db_merge(), that should fix it.

moshe weitzman’s picture

Priority: Normal » Critical

Got to fix before release. OpenID is busted.

Crell’s picture

Assigned: Unassigned » Crell
Status: Active » Needs review
FileSize
1.02 KB

There are some notices in OpenID that have nothing to do with this patch, but this should fix the issue. I was able to register and login successfully with OpenID. I also converted the delete query in the same function, as it seemed a waste to not do so. :-)

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

Yes, this fixes the bug, and code looks good. As you say, OpenID is a bit noisy now. We'll squash those NOTICES elsewhere.

Dries’s picture

Status: Reviewed & tested by the community » Needs work

I've committed this patch to CVS HEAD, but it looks like we need to have a test for this still. Marking it as 'code needs work'.

Crell’s picture

Status: Needs work » Fixed

Let's do the test separately, as it is only tangentially related to this issue: #311462: Test needed: Logging in with OpenID

Anonymous’s picture

Status: Fixed » Closed (fixed)

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