After installing Fancy Login 1.0-Beta2 (on local WAMP) Drupal 7.0 site give a warning:

Strict warning: Only variables should be passed by reference in fancy_login_page_alter() (line 109 of sites\all\modules\fancy_login\fancy_login.module).

Comments

NetStar’s picture

Priority: Critical » Normal

Theme is custom, made from scratch, but i think that is not the problem here.

Its somewwwhat trivial error, but i just can't find out from where it comes.. anyone have a better eye from me?
Just tell me where and what to look and maybe i can fix it and publish changes here.

Due to this error Fancy Login module simply can't be used on live site.

rubaka’s picture

Priority: Normal » Major

I have the same error, using the theme of MAYO. Very urgent need to find a fix ... The author laid out this solution before release.

jspotswood’s picture

I have the same error using the Bartik default theme. Thus it does not seem theme dependent.
This message might not be seen by others if they disable php reporting of strict warnings.

fraguas’s picture

what worked for me was to take this part of the fancy_login.module:

$markup = '<div id="fancy_login_dim_screen"></div>' .
			'<div id="fancy_login_login_box">' .
			'<div id="fancy_login_form_contents">' .
			'<a href="#" id="fancy_login_close_button">X</a>' .
			drupal_render(drupal_get_form('user_login')) .

and change to this:

$userLogin =drupal_get_form('user_login');
		$markup = '<div id="fancy_login_dim_screen"></div>' .
			'<div id="fancy_login_login_box">' .
			'<div id="fancy_login_form_contents">' .
			'<a href="#" id="fancy_login_close_button">X</a>' .
			drupal_render($userLogin) .
caponey’s picture

same error here

latulipeblanche’s picture

Tnx @fraguas .
This works for me.

reo-2’s picture

Status: Needs work » Fixed

tnx it works

Status: Fixed » Closed (fixed)

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

webengr’s picture

FYI, Nov 2012,
I upgraded a server from freebsd8 to freebsd9
and from php 5.3 to php 5.4.7

Then I saw this issuse,
I did the above change in the module and it seems to work for us also.

So I concur if this module is ever updated, we should do consider this for the release candidate

deetergp’s picture

Status: Needs review » Closed (fixed)
StatusFileSize
new972 bytes

The changes fraguas suggested in comment #4 solved the issue I was having on my site, so I thought I would roll it into a patch and put it up on this thread for review and hopefully inclusion in future versions of this module, if there are to be any.

EDIT: Ignore this patch, it is no good. Please try the patch in comment #12 in this thread.

deetergp’s picture

Status: Closed (fixed) » Needs review
deetergp’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new1.38 KB

Please disregard the patch I posted in comment #10 fails a git apply --check.

This patch passes and applies cleanly and should be the one to be used to address this error.

ramrpl’s picture

its work for me.. thank very very very much,,,

drupaljohngo’s picture

worked for me as well.

Could it also be that the php.ini settings are set for developmental errors? I take it this error is not found
on production servers?

keti-1931’s picture

works for me as well.

zura_lanch’s picture

YES - this works perfectly

I had the same error when I moved the site from wamp to acquia dev-desk.

GrantI’s picture

#4 This worked for me, thank you very much indeed!

jaypan’s picture

Version 7.x-2.0 returns this whole section of code as a render array, and doesn't call render() on the form, therefore fixing this issue.

jaypan’s picture

Issue summary: View changes
Status: Needs review » Fixed

The issue causing this bug was a result of calling code like this:

'#markup' => drupal_render(drupal_get_form('user_login')),

The problem here is that drupal_render() expects a variable to be passed to it, that it can then alter directly. I was passing it the result of a function, drupal_get_form(). PHP with strict enforcement doesn't like this (rightfully so).

It is a non-issue now however, as everything is done with render arrays in the new version, and nothing is actually rendered in this function, removing the issue altogether.

Status: Fixed » Closed (fixed)

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