08/22/2014 at 3:59 pm #301617
I continually need to Reset All Roles Capabilities. We are running Connections Version 0.8.14, WordPress 3.9.2 with the latest version of Twenty Twelve. Site: http://www.societyofgilders.org/
The Directory: Members page recently launched for members to edit directory listings which were imported with a Private visibility setting. On more than one occasion a member couldn’t access their entry. Upon investigation, we found the Roles were not defined – meaning, all checkboxes were empty – or, settings were checked and a Reset solved the issue. This situation occurs after two or three successful member edits.
Only 2 Administrators have access to the settings, so I’m baffled. I was wondering if a plugin update resets the settings, or if there’s a known issue related to editing. (We’ve encountered duplicate data entries and resolved that problem with resetting the roles. Thank you forum!!).08/22/2014 at 4:49 pm #301628
Roles and capabilities are persistent. WordPress stores them in the database, so the only way they can be remove is a plugin deletes them. The only code in Connections that can remove capabilities can only be run on the Connections : Roles admin page, there’s an nonce validation in place to ensure that. Connections does have reset code, but that is the same is running the reset all capability option, it does remove them from the core WordPress roles, only custom roles. Connections, a couple years ago, would reset roles on updates but that has long since be removed. The only way that can happen is if the “flag” that is stored in the db that says, hey, the capabilities have been added don’t reset doesn’t exist or has been removed. There’s no code in Connection that can remove that flag. It is there forever…
With all that said and you having to do a “full” reset to fix duplicate data, that tells me something else is mucking with the role capabilities perhaps when they are updated. My suggestion, no elegant sorry, is after each plugin update you do (not just Connections, every plugin) check the roles settings. If we’re lucky, we can figure out what plugin is resetting capabilities.
Can you copy/paste a list of all your active plugins … maybe a few will jump out as possibilities and I can look at their code.08/22/2014 at 5:56 pm #301632
The screenshot wouldn’t play nicely with copy/paste, use this link:
http://www.societyofgilders.org/live/wp-content/uploads/Plugins-‹-Society-of-Gilders.png08/23/2014 at 10:46 am #301712
The attach option will only show when you’re logged in and post a comment…
I did look at the screen capture … the only plugin I know for sure that manages custom roles and capabilities is s2member.
How often does that plugin release updates? Is it possible updates to it coincide with the role capabilities resetting?08/27/2014 at 11:05 pm #302231
I totally forgot to come back over to say thanks for looking at the plugins! My hunch is we’ll discover S2Member to be the culprit. I’ll let you know when it’s time to update again.08/28/2014 at 8:23 am #302276
No problem, let me know what you find out … if it is something I can fix, I will and if I can’t, I’d like to add it to the FAQs.
If I have not asked and you have a moment, I would truly appreciate a review as they really do make a difference. Many thanks in advance!
http://wordpress.org/support/view/plugin-reviews/connections09/22/2014 at 2:20 pm #304801
Problem identified. Updating S2Member resets the Roles. Now that I know that I simply jump over to Connections:Roles and click 3 boxes for the 7 membership levels.09/23/2014 at 9:39 am #304861
Thanks for the follow-up! I’ve logged this … it’s kind of crappy that they remove the custom roles and capabilities that Connections requires. I would consider that a bug in their platform. The best I can do from my side is run a check on admin page loads to see if the roles exists and if they do not re-add them but there not much I can do about re-applying/add back the capabilities to the roles unless I store that separately and try to sync it which can get very complicated and introduced hard to track bugs (potentially). For example, suppose a roles was deleted intentionally, there wouldn’t be a way for my to know that for sure so syncing it would add it back.10/09/2014 at 1:56 pm #306643
so glad to find this thread… it’s not just connections that gets affected everytime there’s an s2member update… and it wasn’t until reading this that i realized that it’s s2member that is indeed the only culprit…
ugh. what a pain. will be very very happy if you can figure out a way to bypass/override that bug … in the meantime, lets all pressure s2member to fix their end.10/09/2014 at 6:53 pm #306665
Sorry to hear you’re having the same trouble. The good news for me is that it does seem to affect other plugins too. Thanks for confirming that for me!
Unfortunately I have not thought of a way to ensure the Connections roles remain.10/09/2014 at 6:58 pm #306666
Seems like there is a simple fix that I can add to my plugin posted here:
I’ll add this to the 8.1.5 release of Connections.