latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

"Only variables can be passed by reference"

Home Forums Community Forum "Only variables can be passed by reference"

This topic contains 8 replies, has 6 voices. Last updated by  Gerard Davies 3 years ago.

Topic Author Topic
Posted: Tuesday Nov 26th, 2013 at 11:36 pm #61421

Just upgraded S2Member to 131126. The upgrade was successful, no errors… But now my entire site is broken (both admin and content display). Whenever any URL is loaded, Apache kicks out the following error:

PHP Fatal error:  Only variables can be passed by reference in /var/www/sitename/wp-content/plugins/s2member/includes/classes/css-js-themes.inc.php on line 57

Lines 57, 58, 59 from css-js-themes.inc.php look like this:

else if(is_singular() && ($post = get_post(NULL))
    && (stripos($post->post_content, "s2member") !== FALSE
        || stripos($post->post_content, "[s2") !== FALSE))

I don’t know enough about PHP to understand what the issue is. Anyone else seeing this after upgrading S2Member?

List Of Topic Replies

Viewing 8 replies - 1 through 8 (of 8 total)
Author Replies
Author Replies
Posted: Wednesday Nov 27th, 2013 at 2:19 am #61432

I encountered the same error upon upgrading to S2Member 131126. My solution was to log into GoDaddy and then using the file manager, restore previous versions of the three S2Member folders I found in the plugins folder. My site is working again, but I would like to know what caused this issue and how to avoid it going forward.

Posted: Wednesday Nov 27th, 2013 at 9:17 am #61437

Glad to know it’s not just me! I’m also happy to hear that if I drop in an older version of the plugin that should work. I had been worried about doing this in case the upgrade changed something in the DB schema. For anyone else searching, older versions can be grabbed from here, and then manually uploaded to the plugins directory.

Posted: Wednesday Nov 27th, 2013 at 10:01 am #61438

Just confirming that I was able to resolve my issue the same way that @tkanigan was. I downloaded v131109 from here, overwrote the contents of plugins/s2member, and everything is back to normal. It doesn’t look like there were any adverse affects. Thanks for the pointer, @tkanigan!

Posted: Thursday Nov 28th, 2013 at 1:55 pm #61474

same issue. same solution.
must be a bug, yes?

Posted: Wednesday Dec 4th, 2013 at 3:28 pm #61611

FYI I had the same issue and was able to fix it like this:

If you go to line 57 in file

s2member/includes/classes/css-js-themes.inc.php

just remove NULL from the call to get_post

so replace this:

else if(is_singular() && ($post = get_post(NULL))

with this:

else if(is_singular() && ($post = get_post())

now my site is working with v 131126

Anyway I’d like to know the advice of the S2 guys.
cheers,
Claudio

Posted: Saturday Dec 7th, 2013 at 10:16 am #61740

Thanks everyone for that fix. G

Posted: Wednesday Dec 11th, 2013 at 9:16 am #61817
Jason Owens
Username: owens310

Claudio,
Thank you so much for the fix you proposed. I tried it, and it worked.

Last night I upgraded to version 131126, and my entire site was completely useless.

I could not even access the admin screen to login. Everything on my site went white! It was completely debilitating.

I was able to figure out how to disable plugins (just use cPanel to rename the s2member folder to something like s2member-disabled). Once I disabled s2member, the site started working again with the exception of not being able to enroll new members or login existing premium members.

While trying to solve this problem this morning I found the error log and then realized I started receiving “…Only variables can be passed… /wp-content/plugins/s2member/includes/classes/css-js-themes.inc.php on line 57” errors. Googling this phrase led me to this thread on the forum.

Bang! Problem solved.

Thanks so much for everyone’s contribution here. If it weren’t for you, I’d still be banging my head.

Jason

  • This reply was modified 3 years ago by  Jason Owens.
Posted: Wednesday Dec 11th, 2013 at 7:08 pm #61835

Er, I might have spoken too soon…
The following error was hidden on the front page (dark colour on darker colour):

Warning: Missing argument 1 for get_post(), called in extranet/wp-content/plugins/s2member/includes/classes/css-js-themes.inc.php on line 57 and defined in extranet/wp-includes/post.php on line 380

I’m php ignorant. What please does it mean by “Missing argument 1”?

Any suggestions?

G

Viewing 8 replies - 1 through 8 (of 8 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.