Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: [s2Member-List levels="0" /] #663

Closed
jaswrks opened this issue Jul 28, 2015 · 2 comments
Closed

Bug: [s2Member-List levels="0" /] #663

jaswrks opened this issue Jul 28, 2015 · 2 comments
Milestone

Comments

@jaswrks
Copy link
Contributor

jaswrks commented Jul 28, 2015

Steps to Reproduce

  • Create two accounts in WordPress: john1 and john2.
  • Role for john1 is Subscriber (Level 0)
  • Role for john2 is s2Member Level 1
  • Use [s2Member-List levels="0" /]

Expected Behavior

Only john1 should be listed.

Observed Behavior

All users are listed.

Problem

if($attr['levels'])

Should be:

if(isset($attr['levels'][0]))

Another Problem

Role-based detection for the levels="" attribute should change s2member_levelN to subscriber whenever the levels="" attribute contains a 0. Currently, entering a 0 into the list of Levels results in Subscribers being excluded; i.e., the levels="" attribute is completely broken when it comes to Free Subscribers; e.g., levels="0,1,2,3" results in Levels 1,2,3 only. Subscribers are excluded, because the Level-to-Role conversion is looking for s2member_level0 instead of subscriber.

jaswrks pushed a commit to wpsharks/s2member-pro that referenced this issue Jul 28, 2015
jaswrks pushed a commit to wpsharks/s2member-pro that referenced this issue Jul 28, 2015
@jaswrks
Copy link
Contributor Author

jaswrks commented Jul 28, 2015

Next Release Changelog:

  • (s2Member Pro) [s2Member-List /] Bug Fix: This release corrects a bug in the [s2Member-List /] shortcode that was causing levels="0" not to work, and in fact any use of a 0 in the levels="" attribute was broken. See this GitHub issue if you'd like additional details. Props to @patdumond for reproducing, reporting and testing this issue.

@jaswrks
Copy link
Contributor Author

jaswrks commented Jul 28, 2015

Short-Term Fix

  • Download this updated file and upload via FTP. Allow this to replace your existing copy of: s2member-pro/includes/classes/sc-member-list-in.inc.php

@jaswrks jaswrks closed this as completed Jul 28, 2015
@raamdev raamdev added this to the Next Release milestone Jul 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants