ammmze
Forum Replies Created
-
Thanks Champ Camba. The pre-release looks good for the issue originally mentioned in this thread.
@trevornanders With the code change I posted, the privacy toggle should work properly again, so you should be okay to enable privacy settings. In my quick test it was working.
Looks like it’s storing it as a serialized array. So you actually probably want this query…
DELETE FROM wp_usermeta WHERE meta_key = 'hide_in_members' and meta_value NOT LIKE '%Yes%';I also have a code change which I’ve applied to one of the plugin files until the issue is resolved. This change updates the query used to list members to take into account the flags that are set but are not set to Yes.
Using the WordPress built-in Plugin Editor, I edited the file
ultimate-member/core/um-filters-members.phpI replaced lines 49-53 with the following
$query_args['meta_query'][] = array( 'relation' => 'OR', array( 'key' => 'hide_in_members', 'value' => '', 'compare' => 'NOT EXISTS' ), array( 'key' => 'hide_in_members', 'value' => 'Yes', 'compare' => 'NOT LIKE' ) );For reference this is what lines 49-53 looked like before:
$query_args['meta_query'][] = array( 'key' => 'hide_in_members', 'value' => '', 'compare' => 'NOT EXISTS' );Yea…if you’ve database access you can delete any record in the
wp_usermetatable where themeta_keyishide_in_membersand themeta_valueis NOT ‘Yes’.So something like this should get them all at once…
DELETE FROM wp_usermeta WHERE meta_key = 'hide_in_members' and meta_value <> 'Yes';Note: I don’t have access to a DB to verify the query, but it should be fairly straight forward
I’m seeing the same thing. I took a look at the plugin’s code where it attempts to delete the flag that marks the profile as private. It is looking for a property named “hide_in_members”, but the POST data shows its sending it as “hide_in_members[]”, so it never makes it into the block of code that deletes the flag. So then when it goes to retrieve the list of member’s, it always checks to make sure that flag does not exist. But since it never deletes it, it only sets its value to “No”, the member gets filtered.
So I see 2 ways to fix the issue. 1) Fix the input name to not set it as an array and/or 2) Update the query to check for the flag being No or not present.
As a workaround before you save the account page, if you run the following javascript code in your browsers javascript console, it should clear out the privacy setting (presumably until you save the account page again without the javascript block)
document.getElementsByName('hide_in_members[]').forEach(function(el){el.setAttribute('name', 'hide_in_members')});