Problem/Motivation

Once user updates any form in content edit page, the preventAutologout() function is triggered then timer will keep looping forever on that editing page.

Proposed resolution

The proposed solution is to add a refresh() function to timer after preventAutologout() finishing its job so that activity is re-set to false and autologout starts to run again.

Remaining tasks

Patch needs to be reviewed.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

johnennew’s picture

Hi Xiao Deng,

Thanks for the patch submission. I'm trying to understand the problem. Are you talking about the JavaScript timer?

torpy’s picture

Hi ceng,

The problem is that if you're on a content edit page (for example) and enter something on the form, the 'formUpdated' event fires, which in turn triggers 'preventAutologout'. This goes off and sets the 'activity' variable to TRUE.

What this does is prevent an automated logout if you're editing a form (which I think is a brilliant feature! :). However, this flag is never reset back to FALSE. So basically, if you idle on that page, you will never be logged out.

Xiao's patch above tried to resolve this but caused multiple timers to be created. My patch (attached) attempts to set a timeout of 1 minute (which is the minimum autologout can be set for) after which activity is set back to FALSE.

johnennew’s picture

Version: 7.x-4.x-dev » 6.x-4.x-dev
Status: Needs review » Active

OK, got it - thanks @torpy. Have committed patch in #2 to 7.x-4.x - setting to 6.x-4.x for the backport. (Feel free to supply a patch or I'll do one when I get a moment.)

johnennew’s picture

Status: Active » Needs review
FileSize
1.54 KB

Patch for 6.x-4.x branch attached

johnennew’s picture

Status: Needs review » Fixed

Committed this patch to 6.x-4.x

Status: Fixed » Closed (fixed)

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

  • Commit 8632888 on 7.x-4.x, 8.x-1.x authored by torpy, committed by ceng:
    Issue #2064719 by Xiao Deng and torpy: Timer reset keeps looping after a...