Download & Extend

Drupal.behaviors.unifiedLogin conflicts with Ajax calls

Project:LoginToboggan
Version:7.x-1.x-dev
Component:Code
Category:bug report
Priority:major
Assigned:Unassigned
Status:active

Issue Summary

The attach function in Drupal.behaviors.unifiedLogin (file "logintoboggan.unifiedlogin.js") gets called when the document/page gets called originally and again every time when the page makes an Ajax call. That can cause problems in the way the Drupal.behaviors.unifiedLogin is currently designed:

1) The events get assigned more than once (which doesn't really matter, unless it fills up the events memory of the browser if that hapens too often)

2) One of the click() event in the switch clause at the end of Drupal.behaviors.unifiedLogin get executed after each Ajax call and that can cause "funny" effects: We call the page /user and the user has no account yet so he switches over to the registration form. If there is a Ajax call (e.g. from a loop), then the form suddenly switches back to the login part of the form and the user gets lost.

I think the whole method should be modified so that it's only called once or by adding a class to the nodes after the first execution so that we know next time, that they won't get executed again.

nobody click here