The grouping methods within a category have been designed to be plugins.
When a custom plugin is added , the recipients across the grouping methods in a category are not being identified properly.
For example, with the current role grouping method and a custom grouping method based on say user creation date, currently
the code gathers all users with the role AND the users satisfying the user creation date condition.
But what is expected is that users that have the chosen role, whose user creation date satisfies the condition chosen should be gathered,
Also a check needs to be added on the category form that a value has been chosen for atleast one grouping method.
Comments
Comment #2
sukanya.ramakrishnan commentedSubmitting a patch for this issue!
Thanks,
Sukanya
Comment #3
sukanya.ramakrishnan commentedComment #4
sukanya.ramakrishnan commentedChanged the message when no recipient types are chosen on the category form to a simpler one. Submitting a patch and interdiff from #2
Comment #6
jhedstromTypo here in 'Atleast' :)
I thought it wasn't possible to create categories without recipients... When it says some other grouping should have categories, then why do we need to select all users here?
Comment #7
sukanya.ramakrishnan commented@jhedstrom. Thanks for your comments.
While it is correct that we cant create categories without recipients, there can be a grouping in a category without any selections.
The getAllActiveUsers() is needed because if we intersect an empty grouping with another grouping with selections, we are going to get an empty resultset.
Comment #8
sukanya.ramakrishnan commentedHmm, now i think a better approach would be to just not add the recipients before doing the intersect, as simple as that.
Will fix that :)
Comment #9
sukanya.ramakrishnan commentedSubmitting patch based ob jhedstrom's review. Also added a test for the categoryform to ensure that there is atleast one recipient selected.
Thanks,
Sukanya
Comment #10
sukanya.ramakrishnan commentedComment #12
jhedstromAwesome! Also, thanks for the test coverage!