Hi,

I use lightbox2 (last version dev on 24 juli). But this is also happens on latest stable version.

I use the login function of lightbox2. Everytime I try to login the url of the lightbox is
http://site.com/user/login/lightbox2?destination=node/407%2523comment-form

I click on the link and the close the lightbox. Then the link has become:
http://site.coml/user/login/lightbox2/lightbox2?destination=node/407%252...

So that's mean the word lightbox2 has been added in the url. This happen everytime I click and the url become longer and longer. This is the login link of a comment form.

Then I add a hardcoded link to the login in the menu. In the beginning the link already has 2 lightbox2 words while I only wrote one (harcoded). So the link is:
http://site.coml/user/login/lightbox2/lightbox2?destination=node%2Fhomepage

The the effect of longer url also happens everyime I click on it.

This is happens on Windows Vista and XP and both firefox and internet explorer.

Sorry but the site is not accessible yet online, so I can't give real url.

Comments

cesarian’s picture

Anyone please fix this?

stella’s picture

Status: Active » Postponed (maintainer needs more info)

I can't reproduce this with the latest dev version. Can you try the newer version instead?

tetramentis’s picture

I have the same issue with Lightbox 6.x-1.9

In Lightbox options I've disabled Login form support, and instead added manually this code:

  Drupal.behaviors.page_init = function (context) {
    //login form
    $("a[@href*='/user/login'], a[@href*='?q=user/login']").each(function() {
      $(this).attr({
        href: this.href.replace(/user\/login?/,"user/login/lightbox2"),
        rel: 'lightmodal[|width:250px; height:210px;]'
      });
    });
  };

It generates a proper URL of the form /user/login/lightbox2, but repetitive clicks (followed by closing the login box) do exactly what the OP described - they add more '/lightbox2' segments to the URL.

Not looking at the code yet, I would think that clicking the login link (OR dismissing the login dialog with a cross at the lower right) somehow triggers this replacement href: this.href.replace(/user\/login?/,"user/login/lightbox2") again and again, and that replacement does not check if the URL already has the '/lightbox2' postfix.

tetramentis’s picture

"Longer URLs" can be fixed by replacing the contains select *= with simple equals select =, like in the example below (which works for clean URLs only), file js/lightbox_modal.js:

old:
$("a[@href*='/user/login'], a[@href*='?q=user/login']").each(function() {
new:
$("a[@href='/user/login'], a[@href*='?q=user/login']").each(function() {

At least for clean URLs, I believe the login URL is always just /user/login, with nothing following it, so '*' from '*=' can be safely omitted (correct me if I'm wrong). Omitting the asterisk stops adding '/lightbox2' segments to the login link on every 'link click'/'modal frame close' pair of events.