Cms: User group and role queries broken in a few spots

Created on 22 Sep 2020  Â·  5Comments  Â·  Source: statamic/cms

Bug Description

  • User group and role queries broken in a few spots.

    • in {{ users }} tag, specifically the group and role parameters

    • in Query\Scopes\Filters\UserGroup and Query\Scopes\Filters\UserRole filters

Extra Detail

  • Group queries like ->where('group', $group) were changed to ->where("groups/$group", true) at some point.

    • Should we delimit with :: like we do everywhere else (ie. groups::handle)?

  • There is no equivalent syntax for querying a user's roles array.

Environment

Statamic version: 3.0.11

bug

Most helpful comment

I had a dream a couple nights ago that @jackmcdade changed the "s" in groups to a letter "z" to to better align with the new website's radical 90's inspired design! Remember JIMMY'Z and the E-Z-In velcro?! Maybe some more ammo for the docs.

Unfortunately, {{ user:in groupz="jocks|geeks" }} doesn't work either.

And, yes, sometimes I have coding dreams.

All 5 comments

I too am experiencing major issues with the Antlers User Tag and the Eloquent Driver (on a fresh install of Statamic 3.0.16).

The example from the Statamic docs does not yield the expected "true" result:
https://statamic.dev/tags/user-in#example

// Broken
{{ user:in group="coaches" }}
    …
{{ /user:in }}

// Works
{{ user }}
    {{ if in_coaches }}
        …
    {{ /if}}
{{ /user }}

I had a dream a couple nights ago that @jackmcdade changed the "s" in groups to a letter "z" to to better align with the new website's radical 90's inspired design! Remember JIMMY'Z and the E-Z-In velcro?! Maybe some more ammo for the docs.

Unfortunately, {{ user:in groupz="jocks|geeks" }} doesn't work either.

And, yes, sometimes I have coding dreams.

😂

This issue has not had recent activity and has been marked as stale — by me, a robot. Simply reply to keep it open and send me away. If you do nothing, I will close it in a week. I have no feelings, so whatever you do is fine by me.

Hey robot, please keep this open. I don't think there's been any changes to role/group stuff since this issue was created so I doubt it's been fixed.

Was this page helpful?
0 / 5 - 0 ratings