Skip to content

Issue with has_role tag #4549

@robinsowell

Description

@robinsowell

Had a report come in that has_role tag is not consistently correct. Tested in 7.5.1:

{exp:member:has_role role_id="6" member_id="2"}
  <p>Has role 6</p>
  {if no_results}
    <p>Not an editor</p>
  {/if}
{/exp:member:has_role}

What I found was it worked UNLESS the primary role was also checked in the additional roles.

Editor is role id 6.

Screenshot 2024-10-23 at 2 33 48 PM

Output: Not an editor

Screenshot 2024-10-23 at 2 35 21 PM

Output: Has role 6

There might be more going on in there, but I can replicate the above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug: AcceptedBug has been confirmed, is reproducible, and ready to work on.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions