Page 1 of 1

Upgrade to WordPress 3.1

PostPosted: February 23rd, 2011, 3:27 pm
by AdmiralsReserve
Is anyone else encountering problems with the plug-in after upgrading to V3.1?

Re: Upgrade to WordPress 3.1

PostPosted: February 23rd, 2011, 8:45 pm
by dwdutch
Yep... just upgraded. Now with WP 3.1 and S2M 3.3.2. go to Users page and I see an error message:

Warning: Invalid argument supplied for foreach() in [URL-ROOT]/wp-content/plugins/s2member/includes/functions/users-list.inc.php on line 90

Checking out the file, line 90 reads:

Code: Select all
foreach ($user->allcaps as $cap => $cap_enabled)



I haven't fully explored this impact on custom capabilities. I'll continue looking for other issues first.

What have you seen?

Re: Upgrade to WordPress 3.1

PostPosted: February 24th, 2011, 1:14 am
by AdmiralsReserve
Got exactly the same - plus I have also lost the date and time when some of the users registered for the site

Re: Upgrade to WordPress 3.1

PostPosted: February 24th, 2011, 3:13 am
by urbanryno
oh, crap. that would be bad (the registered date)

Re: Upgrade to WordPress 3.1

PostPosted: February 24th, 2011, 4:02 am
by AdmiralsReserve
Am getting that issue right across the board for members that have paid a subscription and also those that are using areas of the site for free

Re: Upgrade to WordPress 3.1

PostPosted: February 24th, 2011, 5:08 pm
by urbanryno
yup. and total silence from support even when you email them at their support email address. total silence even though they say

"We're committed to our customers and have a passion for technology. We hold ourselves accountable to our customers, partners, and employees; by honoring our commitments, providing results, and striving for the highest quality. Our work is based on the belief that products and services are only as strong as the support team standing behind them."


starting to not look like they mean what they advertise. :cry:

Re: Upgrade to WordPress 3.1

PostPosted: February 25th, 2011, 10:26 am
by johnnysilvers
I have experienced the same issue and there are now several threads here all detailing the same thing.

Being new to this forum, is there a reliable single source place to get news of updates or bugs like this?

Thanks!

Re: Upgrade to WordPress 3.1

PostPosted: February 25th, 2011, 12:59 pm
by JamesUT
Hi,

I'm not sure how deep the issue goes, but for the warnings on the users listing I did the following:

In wp-content/plugins/s2member/includes/functions/users-list.inc.php around line 90 find:
Code: Select all
foreach ($user->allcaps as $cap => $cap_enabled)
if (preg_match ("/^access_s2member_ccap_/", $cap))
$ccaps[] = preg_replace ("/^access_s2member_ccap_/", "", $cap);
/**/
$val = (!empty ($ccaps)) ? implode ("<br />", $ccaps) : "—";

add the if condition above it and closing bracket below as shown:
Code: Select all
if (is_array($user->allcaps)) {
foreach ($user->allcaps as $cap => $cap_enabled)
if (preg_match ("/^access_s2member_ccap_/", $cap))
$ccaps[] = preg_replace ("/^access_s2member_ccap_/", "", $cap);
/**/
$val = (!empty ($ccaps)) ? implode ("<br />", $ccaps) : "—";
}

This just has it check if it's an array or not and execute accordingly. It got rid of the warnings on my installs.

Hope this helps.

Re: Upgrade to WordPress 3.1

PostPosted: February 25th, 2011, 1:41 pm
by Cristián Lávaque
So before WP 3.1 $user->allcaps would always output an array and now it sometimes doesn't? Just trying to understand what the issue is.

If $user->allcaps is used elsewhere, then a similar problem may come up. Would be good to go where $user->allcaps is and make sure it always outputs an array.

Re: Upgrade to WordPress 3.1

PostPosted: February 25th, 2011, 2:31 pm
by itsalaska
This is my solution:
Code: Select all
if(!$user->allcaps) $user->allcaps = array();

Place it at line 90 before the foreach. solves the issue.

Re: Upgrade to WordPress 3.1

PostPosted: February 25th, 2011, 5:40 pm
by J_J_R
@itsalaska and @JamesUT

Sorry folks, but this can't be the answer. It breaks the Pretty Links plugin and god knows what all else. This is really frustrating me because I have a membership site due to launch on Tuesday and I've been torpedoed.

Re: Upgrade to WordPress 3.1

PostPosted: February 25th, 2011, 5:48 pm
by Cristián Lávaque
J_J_R wrote:This is really frustrating me because I have a membership site due to launch on Tuesday and I've been torpedoed.


I can understand that.

Re: Upgrade to WordPress 3.1

PostPosted: February 25th, 2011, 8:14 pm
by J_J_R
Maybe the approach is wrong..does anybody know how to revert to WP 3.05?

Re: Upgrade to WordPress 3.1

PostPosted: February 26th, 2011, 1:11 am
by lalitkishore
Yes you can downgrade to 3.05. Just follow the procedure for manual upgrade and replace files from 3.1 with 3.05. Make sure that you follow the instructions and do not replace the following files and folders:
wp-config.php file;
wp-content folder;
wp-images folder;
wp-includes/languages/ folder--if you are using a language file, do not delete this folder;
.htaccess file--if you have added custom rules to your .htaccess, do not delete it;
Custom Content and/or Plugins--if you have any images or other custom content or Plugins inside the wp-content folder, DO NOT delete them.

One of the links to do that is given here
http://www.siteground.com/tutorials/wor ... pgrade.htm

Re: Upgrade to WordPress 3.1

PostPosted: February 26th, 2011, 8:21 am
by J_J_R
Gotta say this makes me more than a little nervous.

My hosting company was able to roll me back to 3.05 and I was pretty excited about it until I realized that all the databases had been rolled back too (losing 2.5 days of work).

So, the next concept was to use the latest databases and hook them into the old WordPress. (It didn't work for some reason. Remember that. :? ).

Next, I asked them to put me back just how it was before I called (WP 3.1) and give me a few minutes to manually copy off the pages I needed. The plan being to manually install them into WP 3.05 later.

Good plan, right? makes sense in a desperate sort of way. So, what happened?

Apparently, in the 20 minutes it took me to make my copies, their servers updated for the week and blew away the WP 3.05 data! No way to recover WP 3.05 now. Who's really buying that story?

Anyway, that was a rather long winded way of saying that I'm not sure my latest database versions will operate with the old WP 3.05, even if I did manage to manually re-install it.

Re: Upgrade to WordPress 3.1

PostPosted: February 26th, 2011, 9:13 am
by Elizabeth
s2Member has been upgraded to address this issue.
http://www.primothemes.com/readme/3679/#rm-changelog
1.5

* (s2Member/s2Member Pro). WordPress® 3.1. Updated for full compatibility with WordPress® 3.1 ( s2Member also remains compatible with the WordPress® 3.0.x series ).

Please upgrade to the latest version.

Re: Upgrade to WordPress 3.1

PostPosted: February 26th, 2011, 11:25 am
by camillemm
At last a good news ! Hope it helps everybody (I was praying the silence was due to hard work on a WP 3.1 compatible version).

Re: Upgrade to WordPress 3.1

PostPosted: February 26th, 2011, 3:04 pm
by J_J_R
At last a good news ! Hope it helps everybody (I was praying the silence was due to hard work on a WP 3.1 compatible version).


My thoughts EXACTLY.

Re: Upgrade to WordPress 3.1

PostPosted: February 26th, 2011, 4:43 pm
by itsalaska
J_J_R wrote:@itsalaska and @JamesUT

Sorry folks, but this can't be the answer. It breaks the Pretty Links plugin and god knows what all else. This is really frustrating me because I have a membership site due to launch on Tuesday and I've been torpedoed.


As a 10 year php developer, trust me i know my stuff, and i see no reason why making an empty variable become an empty array would screw anything up, not to mention that it is contained within a class so it can't possibly affect another plugin.