Hello,

In fancy_login.js on line 96 there is:

$("a[href*='user/login']").each(function()

But if you use an alias for the login path, JS can not find the link unfortunately as it is hard coded, and FL breaks.

Possibly there are many non-English users who path aliased the login path, and they might think the module is broken or has junky coding.

I know it is (almost) impossible to get the alias of a path as a JS variable, but at least this can be documented. A minor glitch, but may be critical.

Tx.

Comments

jaypan’s picture

I may be able to fix this. I changed the code locally in my development version of the module, and it still works, but I'm not sure how you have it aliased, so I need you to test it out for me and let me know if it works.

There are two pieces of code you have to change. First, open up fancy_login.module, and replace this code:

function fancy_login_init()
{
	if(user_is_anonymous())
	{
		$path = drupal_get_path('module', 'fancy_login');
		$fl_settings = array
		(
			'screenFadeColor' => variable_get('screen_fade_color', 'white'),
			'screenFadeZIndex' => variable_get('screen_fade_z_index', '10'),
			'loginBoxHeight' => variable_get('login_box_height', 'auto'),
			'loginBoxWidth' => variable_get('login_box_width', '175px'),
			'loginBoxBackgroundColor' => variable_get('login_box_background_color', 'white'),
			'loginBoxGextColor' => variable_get('login_box_text_color', 'black'),
			'loginBoxBorderColor' => variable_get('login_box_border_color', 'black'),
			'loginBoxBorderWidth' => variable_get('login_box_border_width', '3px'),
			'loginBoxBorderStyle' => variable_get('login_box_border_style', 'solid'),
		);
		if(variable_get('fancy_login_no_redirect', 0))
		{
			$fl_settings['destination'] = 'destination=' . $_GET['q'];
		}
		drupal_add_js(array('fancyLogin' => $fl_settings), 'setting');
		drupal_add_js($path . '/scripts/fancy_login.js');
		drupal_add_css($path . '/css/fancy_login.css');
	}
}

with this code:

function fancy_login_init()
{
	if(user_is_anonymous())
	{
		$path = drupal_get_path('module', 'fancy_login');
		$login_path = drupal_get_path_alias('user/login');
		$fl_settings = array
		(
			'screenFadeColor' => variable_get('screen_fade_color', 'white'),
			'screenFadeZIndex' => variable_get('screen_fade_z_index', '10'),
			'loginBoxHeight' => variable_get('login_box_height', 'auto'),
			'loginBoxWidth' => variable_get('login_box_width', '175px'),
			'loginBoxBackgroundColor' => variable_get('login_box_background_color', 'white'),
			'loginBoxGextColor' => variable_get('login_box_text_color', 'black'),
			'loginBoxBorderColor' => variable_get('login_box_border_color', 'black'),
			'loginBoxBorderWidth' => variable_get('login_box_border_width', '3px'),
			'loginBoxBorderStyle' => variable_get('login_box_border_style', 'solid'),
			'loginPath' => $login_path,
		);
		if(variable_get('fancy_login_no_redirect', 0))
		{
			$fl_settings['destination'] = 'destination=' . $_GET['q'];
		}
		drupal_add_js(array('fancyLogin' => $fl_settings), 'setting');
		drupal_add_js($path . '/scripts/fancy_login.js');
		drupal_add_css($path . '/css/fancy_login.css');
	}
}

Note: ignore the opening and closing php tags (<?php and ?>). Use all the code between them.

Next, open open up scripts/fancy_login.js, and go to line 96 (the one you mentioned earlier, and replace this code:

$("a[href*='user/login']").each(function()

with this code:

$("a[href*='" + Drupal.settings.fancyLogin.loginPath + "']").each(function()

Depending on how you have aliased the login path, this *should* work. But we'll only know with testing. If it does work, let me know, and I will commit these changes tot he module and re-release it.

jaypan’s picture

Status: Active » Postponed (maintainer needs more info)
chawl’s picture

Patch is perfectly working (for me) with an aliased login path, tx :)

jaypan’s picture

Great! I'll commit this and re-release the module with the changes.

Edit: Thanks for testing that for me.

chawl’s picture

Status: Postponed (maintainer needs more info) » Fixed

Kind of you :) Also confirming RC2 is OK, then...

jaypan’s picture

Yes, the changes were committed for RC2.

Status: Fixed » Closed (fixed)

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