x First time here? Check out the FAQ

Learn from 350 other Umbracians at the annual Umbraco Conference - CodeGarden '13.
More than twenty high quality sessions, open spaces, hackathons and social events you'll remember. Not to be missed!
Less than 25 tickets left - get yours now!

  • Avatar206posts247karma

    Multiple member groups

    Harald Ulriksen started this topic August 26, 2010 @ 09:31

    There seems to be an error where only the first of the filtered grupes is used.

    In FilteredMemberPickerDataType.cs the filter seems to be applied, but it only use the first value.

     

     

     

    //- Add the filters

     

     

    if (filters.Length == 1)

    {

    sb.Append(

     

    "(cmsMember2MemberGroup.MemberGroup = " + filters[0] + ")");

    }

     

     

    else if (filters.Length > 1)

    {

     

     

    foreach (string s in filters)

    {

    sb.Append(

     

    "(cmsMember2MemberGroup.MemberGroup = " + filters[0] + ") OR ");

    }

     

     

    //- Remove the trailing OR

    sb.Remove(sb.Length - 3, 3);

    }

     

    suggest filters[0] in the foreach loop is changed to s. or something like this

    //- Add the filters

     

     

    if (filters.Length > 0)

    {

     

     

    foreach (string s in filters)

    sb.Append(

     

    "(cmsMember2MemberGroup.MemberGroup = " + s + ") OR ");

     

     

    //- Remove the trailing OR

    sb.Remove(sb.Length - 3, 3);

    }


    Cheers,
    Harald


Please login or Sign up To post replies