x First time here? Check out the FAQ
Join us a the Umbraco event of the year - get your Codegarden 14 early bird ticket today
  • 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