On a test site using D7-beta1 (not yet b2...), when I try to install and enable this module for the first time, I get this error when enabling it:

"DatabaseSchemaObjectExistsException: Table <em class="placeholder">autologout</em> already exists. in DatabaseSchema->createTable() (line 621 of /.../includes/database/schema.inc).
The website encountered an unexpected error. Please try again later.  "

This module has never been used on this site before, so that table probably does not exist before activating this module.

Subsequently, I get 2 instances of the following error an all pages:

" * Notice: Undefined index: authenticated user in _autologout_by_role() (line 527 of /.../sites/all/modules/autologout/autologout.module). "

The module does not work in this state, just had to disable it.

CommentFileSizeAuthor
#4 autologout-install-fix.patch714 bytesacbramley

Comments

akoepke’s picture

The .install file needs to be edited so it doesn't call the autologout_schema function. D7 calls this function by default so by calling it during the install phase it is actually trying to create the table in twice.

Seph’s picture

I just got the same error after enabling the module in D7.2 What exactly needs to be edited to correct this? New to coding and still learning.

DatabaseSchemaObjectExistsException: Table autologout already exists. in DatabaseSchema->createTable() (line 629 of .../includes/database/schema.inc).

akoepke’s picture

There is a file called autologout.install, line 15 is below

  drupal_install_schema('autologout');

Remove that line as it is not needed with Drupal 7.

acbramley’s picture

StatusFileSize
new714 bytes

A patch for this should be committed to 2.x as this is a "critical" bug with an easy fix. Here's a patch that removes the incorrect function calls.

jrglasgow’s picture

Status: Active » Fixed

that patch in #4 has been committed

Status: Fixed » Closed (fixed)

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

  • Commit 599316a on 7.x-2.x, 7.x-5.x, 7.x-4.0, 8.x-1.x by jrglasgow:
    #960356 by Zombienaute | DanielTheViking: Fixed Activation error: Table...