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.

Capabilities wiped out post upgrade

Home Forums Community Forum Capabilities wiped out post upgrade

This topic contains 15 replies, has 4 voices. Last updated by  Jason (Lead Developer) 4 years, 10 months ago.

Topic Author Topic
Posted: Thursday Feb 16th, 2012 at 4:55 am #5352

I just upgraded to v120213 Pro and it appears that all the user capabilities assigned to different levels were wiped out. I haven’t checked custom capabilities I added to specific users, but I can see that the capabilities I added to various levels are all gone.

List Of Topic Replies

Viewing 15 replies - 1 through 15 (of 15 total)
Author Replies
Author Replies
Posted: Thursday Feb 16th, 2012 at 12:14 pm #5375

So I went through each level and added back the correct user capabilities, but something else odd is wrong (and very problematic). I noticed that the admin cannot access a page that is restricted to Level 4. I get sent to the membership page like any user that cannot access the page. A level 4 user can access it, but the admin (which has access to level 4 – I double checked the user capabilities) cannot.

Posted: Thursday Feb 16th, 2012 at 12:33 pm #5380

I think the access to the level 4 page is working now, not sure what changed, although I did log out and back in.

Posted: Thursday Feb 16th, 2012 at 11:57 pm #5438
Raam Dev
Username: Raam
Staff Member

Hi Philip,

Are you still having an issue or did you solve it?

Posted: Tuesday Feb 21st, 2012 at 9:04 am #5856

Raam,

I fixed it only be re-adding the capabilities using User Role Editor. This took a little trial-and-error as I had to add back capabilities for different levels from memory. I’m a little afraid to upgrade now to the latest version, as I don’t want this to keep happening. Is whatever you changed with capabilities going to occur on every upgrade?

Posted: Wednesday Feb 22nd, 2012 at 2:31 am #5919

Another odd problem is I just tried to go to a page that is restricted to Level #4, using an Administrator account, and I got redirected to the Membership page.

Posted: Wednesday Feb 22nd, 2012 at 3:00 am #5921

Going to the page a second time showed it properly. Weird, but still a bug of some kind.

Posted: Wednesday Feb 22nd, 2012 at 11:07 am #5946
Raam Dev
Username: Raam
Staff Member

Hi Philip,

You definitely should not have lost any Custom Capabilities or any other configuration when you upgraded s2Member.

Could you please check to make sure Deactivation Safeguards are enabled? WP Admin -> s2Member -> General Options -> Deactivation Safeguards

I also suggest clearing your browser cache if you’re noticing inconsistencies in what you have access to.

Posted: Thursday Feb 23rd, 2012 at 6:57 am #6107

I did check the deactiviation safeguards before upgrading. Obviously I should not have lost custom capabilities, but it happened. Is no else reporting this problem?

Posted: Thursday Feb 23rd, 2012 at 2:30 pm #6147
Raam Dev
Username: Raam
Staff Member

Hi Philip,

I have not heard of any other reports of that happening. I personally use s2Member with custom capabilities on my site and I did not experience that issue when upgrading.

It’s possible this could be related to a strange server configuration with your web host. I recommend doing a database backup before your next upgrade and seeing if it happens again. If it does, I recommend contacting your web host and explaining the issue.

Posted: Friday Feb 24th, 2012 at 11:36 pm #6383

Philip, what version did you have before the upgrade?

Posted: Wednesday Feb 29th, 2012 at 2:50 am #6736

Whatever the previous version was. I generally don’t skip updates.

Posted: Wednesday Feb 29th, 2012 at 3:21 am #6740

Got ya.

I’ll email Jason asking him what he thinks could have caused that problem for you.

Posted: Wednesday Feb 29th, 2012 at 10:58 pm #6850
Staff Member

Thanks for the heads up on this thread.
I’m very sorry for any confusion.

I fixed it only be re-adding the capabilities using User Role Editor. This took a little trial-and-error as I had to add back capabilities for different levels from memory. I’m a little afraid to upgrade now to the latest version, as I don’t want this to keep happening. Is whatever you changed with capabilities going to occur on every upgrade?

Yes, by default, s2Member will update it’s core Roles/Capabilities during an upgrade. However, if you’ve made custom modifications to these s2Member Roles/Capabilities, you can lock them in to prevent modification during future upgrades. You’ll find this documented in your Dashboard here:
Dashboard -› s2Member® -› General Options -› Membership Levels/Labels
(look toward the bottom of this section in your Dashboard)

See also, this thread please:
http://www.primothemes.com/forums/viewtopic.php?f=36&t=15420&p=45162#p45162

Instructions:

Create this directory and file:
/wp-content/mu-plugins/s2-hacks.php
( these are MUST USE plugins, see: http://codex.wordpress.org/Must_Use_Plugins )

<?php
add_filter("ws_plugin__s2member_lock_roles_caps", "__return_true");
?>
Posted: Saturday Mar 3rd, 2012 at 5:41 pm #7195

Thanks. I’ve added the s2-hacks.php file with the code. Perhaps this would be better as a checkbox in the Membership Levels/Labels section? Why exactly does s2member clear all the user capabilities in the first place?

Posted: Tuesday Mar 6th, 2012 at 1:17 am #7383
Staff Member

KB article published covering this topic.
Locking s2Member Roles/Capabilities

Viewing 15 replies - 1 through 15 (of 15 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.