Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#1 | login_one_time-passed_by_ref-1781340-1.patch | 603 bytes | nlisgo |
login_one_time-passed_by_ref.png | 16.64 KB | nlisgo |
Comments
Comment #1
nlisgo CreditAttribution: nlisgo commentedHere is the patch.
Comment #2
nlisgo CreditAttribution: nlisgo commentedAnyone going to review this? Surely, I 'm not the only one experiencing this!
Comment #3
Offlein CreditAttribution: Offlein commentedWorkin' for me!
Comment #4
mortona2k CreditAttribution: mortona2k commentedThis works in 7-2.8.
Comment #5
dmitrii CreditAttribution: dmitrii commentedit works for me
Comment #6
marcusx CreditAttribution: marcusx commentedTested and working.
Comment #7
ehowland CreditAttribution: ehowland commentedHmmm. 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?
Comment #8
ehowland CreditAttribution: ehowland commentedUpdated: 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.
Comment #9
nlisgo CreditAttribution: nlisgo commentedehowland, 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
Comment #10
joelpittetThat 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:
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).
Comment #11
Maedi CreditAttribution: Maedi commentedPatch 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 :)
Comment #12
Offlein CreditAttribution: Offlein commentedAs 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.
Comment #13
joelpittetThanks for fixing this, one less patch to maintain! And yes Offlein deserves satisfaction... maybe not attribution but yeah:P
Comment #14
nlisgo CreditAttribution: nlisgo commentedI'm happy to see any fix get in. thanks for the explanation about the attribution. Good luck maintaining the module.