Hi, thank you for developing this super useful plugin!
I’m currently using Discourse Dynamic Groups to automatically add all non-anonymous users to a special group. My boolean expression is:
NOT anonymous_users
Expected behavior:
When a new user registers (who does not belong to the anonymous_users group), they should be automatically added to this group, without any manual intervention.
Actual behavior:
Newly registered users are not immediately added to the group. They only get added after I manually re-save the boolean expression in the group settings.
This means the group is not updated automatically as users join, unless I trigger a manual sync.
I get the error: Unknown keyword, group or badge: 'anonymous_users'
If I change the group name to my actual group, for example:
trust_level_0 AND NOT interns
I still get: Unknown keyword, group or badge: 'interns'
I have double-checked and I am copying the group’s unique name directly from the group admin page, so there are no typos.
Is there anything I might be missing, or is there something else I need to configure for custom groups to be recognized in the expression?
While trying to reproduce, I have identified two bugs and one of them probably hit you.
Can you please update the plugin to the latest version 59640f1 and see if that resolves the issue.
The plugin still does not deal with renaming groups very well. If you rename a group you should save the rules from all groups that depend on it (just enter a space after the boolean expression and remove it again to enable the Save button). This will be addressed in a later version.
Users with trust level 1 are also members of the trust level 0 group. So the behavior is expected. You could exclude the trust level 1 group to only get TL0 users. Similar to the example from the first post
While I can understand why, this does cause some problems when you want to muck about with the Default title, Flair, and Effect.
This can be worked around by either revealing the tab in the browser console, or removing the expression in the Dynamic Groups tab, refreshing, making the changes, pasting it back again, and again refreshing.
But I do wonder if it might be better to just hide the fields that aren’t helpful instead, rather than the whole tab. Something more like this:
Yeah, I worked that out in the time between posting and you replying!! I hadn’t appreciate that you hook into core functionality with it - slickly done too.
Have crossed out my incorrect suggestion.
I guess the other workaround I outlined is fine then.
It does raise another problem that I hadn’t realised - automatic groups are NOT visible to non-staff users. And that is deeply coded in. Rats!
We’re going to do a maintenance round on all plugins in the next month or so, maybe we need to revisit the ‘automatic’ flag since as far as I recall it was just a quick way on disabling the add/remove members functionality. All other things are probably unwanted side effects.