This is an easy one to fix. I will attach a patch in a comment. The error is in the login_one_time_button function. drupal_render is expecting a variable to be passed as it may wish to alter the value.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nlisgo’s picture

Status: Active » Needs review
FileSize
603 bytes

Here is the patch.

nlisgo’s picture

Anyone going to review this? Surely, I 'm not the only one experiencing this!

Offlein’s picture

Status: Needs review » Reviewed & tested by the community

Workin' for me!

mortona2k’s picture

This works in 7-2.8.

dmitrii’s picture

it works for me

marcusx’s picture

Tested and working.

ehowland’s picture

Hmmm. Not working for me

Strict warning: Only variables should be passed by reference in login_one_time_button() (line 229 of /home5/xxx2/live.xxx2/html/sites/all/modules/login_one_time/login_one_time.module).

I am running login_one_time-7.x-2.8 and PHP 5.4
and I can confirm that the patch is applied and this error started recently - maybe when the hosting updated PHP. Is PHP 5.4 somehow stricter?

Drupal version                  :  7.24                                                     
 Site URI                        :  http://default                                           
 Database driver                 :  mysql                                                    
 Database                        :  Connected                                                
 Drupal bootstrap                :  Successful                                               
 Drupal user                     :  Anonymous                                                
 Default theme                   :  pixture_reloaded                                         
 Administration theme            :  seven                                                    
 PHP configuration               :  /usr/php/54/etc/php.ini /home5/xyz2/.drush/drush.ini 
 Drush version                   :  5.9                                                      
 Drush configuration             :                                                           
 Drupal root                     :  /home5/xyz2/live.xyz2/html                        
 Site path                       :  sites/default                                            
 File directory path             :  sites/default/files                                      
 Private file directory path     :  sites/default/files/private                              
 Temporary file directory path   :  /tmp                                                     
ehowland’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Active

Updated: Comment #N

Problem/Motivation

Even after the patch has been accepted into login_one_time-7.x-2.8 this problem is appearing with PHP 5.4

Original report by nlisgo

https://drupal.org/node/1781340

More detail.

nlisgo’s picture

ehowland, can you confirm that the patch applied correctly. The patch was prepared for the dev version of the module not login_one_time-7.x-2.8

Could you perhaps output line 229 of login_one_time.module

joelpittet’s picture

Status: Active » Reviewed & tested by the community

That sounds like the patch wasn't correctly installed.

This is correct, you can't pass the output of a function directly as an argument to drupal_render().

Assuming mac/linux environment here's a quick way to apply the patch:

cd sites/all/modules/login_one_time
curl https://www.drupal.org/files/login_one_time-passed_by_ref-1781340-1.patch | patch -p1
drush cc all

Making sure you are in the module's folder (adjust if your module is elsewhere) and clear the cache(can do this on the performance page through the UI).

Maedi’s picture

Status: Reviewed & tested by the community » Fixed

Patch has made its way into the dev release as part of #2429977: New Feature: Rules Comment Token. Commit attribution was lost in the coding chaos, please let me know if you'd like a special commit made for attribution. I've just started co-maintaining this module :)

Offlein’s picture

As the first person to comment "Workin' for me!" I demand satisfaction and special recognition!!

..Ah, y'know what, I guess it's fine to skip it this time.

joelpittet’s picture

Thanks for fixing this, one less patch to maintain! And yes Offlein deserves satisfaction... maybe not attribution but yeah:P

nlisgo’s picture

I'm happy to see any fix get in. thanks for the explanation about the attribution. Good luck maintaining the module.

Status: Fixed » Closed (fixed)

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