Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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();
Comment | File | Size | Author |
---|---|---|---|
#3 | openid_db_merge.patch | 1.02 KB | Crell |
Comments
Comment #1
Crell CreditAttribution: Crell commentedIt 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.
Comment #2
moshe weitzman CreditAttribution: moshe weitzman commentedGot to fix before release. OpenID is busted.
Comment #3
Crell CreditAttribution: Crell commentedThere 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. :-)
Comment #4
moshe weitzman CreditAttribution: moshe weitzman commentedYes, this fixes the bug, and code looks good. As you say, OpenID is a bit noisy now. We'll squash those NOTICES elsewhere.
Comment #5
Dries CreditAttribution: Dries commentedI'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'.
Comment #6
Crell CreditAttribution: Crell commentedLet's do the test separately, as it is only tangentially related to this issue: #311462: Test needed: Logging in with OpenID
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.