Closed (fixed)
Project:
Automated Logout
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Jan 2011 at 18:47 UTC
Updated:
7 Aug 2017 at 09:38 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Anonymous (not verified) commentedI'm getting exactly the same error on login.
Fatal error: Call to undefined function db_fetch_object() in D:\My Documents\Drupal 7\sites\all\modules\autologout\autologout.module on line 563
Regards
Comment #2
justintime commenteddb_fetch_object() doesn't exist now, nor will it ever exist in D7. Removing it was part of the DBTNG rewrite. This tells me that the 7.x-2.x branch isn't even being used by the developers, because this would've been caught right away.
The really shitty thing is that simply installing this module will completely break a D7 site, and you have to manually remove the module in order to be able to login again. In order to restore your site, open up the autologout.module file mentioned in your error, and find the lines that say this:
Delete those 3 lines. You can now go in and disable+uninstall the module via the UI.
Marking as a critical bug report because any D7 site using this will immediately break. Yes, I understand it's a dev snapshot, but if the branch is this broken, please remove the release.
Comment #3
Anonymous (not verified) commentedIt's working for me now, even with the code quoted by justintime remaining in place.
UPDATE: Spoke too soon. Error still occurring.
Comment #4
ellen.davis commentedA user posted a fix for Custom Permissions issue queue for this same problem - db_fetch_object undefined.
See http://drupal.org/node/1097558
Basically the suggestion was to replace the while with a foreach.
Replace
With
This seems to work for me, at least I don't get the error anymore.
Comment #5
Anonymous (not verified) commentedI also don't get the error message anymore.
Instead I get:
Also, the UI for the module seems to have gone missing.
Is this module still being maintained? There doesn't seem to have been any activity for months.
Comment #6
daften commentedsubscribe
Comment #7
NROTC_Webmaster commentedsub
Comment #8
webengr commentedsubscribe
Comment #9
kmasood commentedTried that, but it does not log the user out. Does it function for you otherwise?
Comment #10
iansears commentedsubscribe
Comment #11
ryantollefson commented#4 fixed the error for me. I haven't verified if it is actually working or not though.
Comment #12
jlyon commented#4 works for me as well.
Comment #13
Jesuscares commentedAfter applying the change in #4, I also get that error mentioned in #5!
Specifically I get this showing at the top of the user UI now:
Notice: Undefined index: authenticated user in _autologout_by_role() (line 526 of /home/foobarsite/public_html/sites/all/modules/autologout/autologout.module).
Any fix for that?
Comment #14
BenK commentedSubscribing
Comment #15
Jesuscares commentedI'm going to try out the persistent Login module (there's a Drupal 7 dev release) until the Automated Login module is working for Drupal 7
Update 2011-09-30: The "Persistent Login" module didn't work for me either. It sure would be great if someone could fix "Automated Login" for Drupal 7. I have a security risk without this module because many of my users are novice internet users and Drupal 7 allows their session to stay logged in on a public terminal if they don't take the time to logout.
This is such a large issue that I've been counseled by a very experienced Drupal developer to revert back to Drupal 6. That would be unfortunate because this Logout issue is the only issue I have with Drupal 7 at this time.
Comment #16
kmasood commentedI have a working copy of autologout on D7 (see note here: http://drupal.org/node/1117706#comment-4897540 ). What is the best way to post it? Attach it to this thread?
Comment #17
Jesuscares commented@kmasood (Re: #16) Thanks! I'm not certain, but that link to where you have a "patch" is something I'm going to try! thanks!
I tried it and still received an error while trying to login:
Fatal error: Call to undefined function db_result() in /home/ogcmwil4/public_html/sites/all/modules/autologout/autologout.module on line 696
Here's the code around line 696 (I've labeled line 696):
function _autologout_invalidate_other_sessions($account) {
// check to see if the user is already logged in somewhere else
// if so deactivate that login and let the user know that the
// other session has been deactivated
$sql = "SELECT COUNT(*) as count FROM {sessions} WHERE uid = '%s' AND sid <> '%s'";
696: $result = db_result(db_query($sql, $account->uid, session_id()));
//drupal_set_message('session counts = '. $result);
if ($result != 0) {
Comment #18
jlyon commented@kmasood; Could you post your working version as a patch of the current 7.x-dev branch or a tarball? Thanks!
Comment #19
kmasood commentedTar ball attached. Please give credit to A. Riberi of chapterthree.com.
Comment #20
domesticat commentedMarking "needs review" to help nudge others into testing.
Comment #21
ryantollefson commented#19 works pretty well for me; however, I'm getting a little bit of strange behavior. It seems that when viewing an overlay page, it will redirect to the /user/# page shortly before the timeout is reached (and the timer is reset). When disabling the module, this action stops.
Great progress so far though. :)
Comment #22
ryantollefson commentedAnother thing I am noticing is that the timer is not reset when using overlay pages - it keeps going from before that page was opened.
Comment #23
kmasood commentedWe've disabled overlays because of the performance overhead (and in my personal opinion, some UI overhead as well), and not seeing #s 21 & 22 when overlay is disabled.
Comment #24
remyarose commented#19:- Thanks..this one works for me....
Comment #25
grayaj88 commented#19:- working for me as well. Thanks for this update.
Comment #26
netourish commentedThank You all!, @nitmd for posting this and @kmasood for the solution. It worked for me.
Comment #27
trrroy commentedYes, works for me. I used @kmasood files from #19 and created the attached patch file. Thanks @kmasood and A. Riberi of chapterthree.com
Comment #28
jrglasgow commented@trrroy - I applied the patch and committed it. There was one error with the patch, next time please create the patch against the git branch instead of the dev build
Comment #30
subhojit777thank you soooo much
Comment #31
sayantanlaha commentedI have got the same error when I am trying to fetch my custom module data.......but now it got fixed.
Comment #33
vishnu9609 commented#4 works for me.. Thanks..
Comment #34
vishnu9609 commented