Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.x]: User conditional not applied when starting project, inspite it being set in the project config #15037

Closed
boboldehampsink opened this issue May 21, 2024 · 2 comments
Assignees
Labels

Comments

@boboldehampsink
Copy link
Contributor

boboldehampsink commented May 21, 2024

What happened?

Description

A user conditional with the following rules is not applied when starting a project for the first time:

userCondition:
              class: craft\elements\conditions\users\UserCondition
              conditionRules:
                -
                  class: craft\elements\conditions\users\GroupConditionRule
                  operator: in
                  uid: 34b06532-29f1-44a6-9acf-ba26f8a7389e
                  values:
                    - 21006657-ecd9-43d2-8813-4cfc3db35488 # **USERGROUP**
              elementType: craft\elements\User
              fieldContext: global

Steps to reproduce

  1. Create a usergroup
  2. Create an entry type
  3. Add a field with the condition as seen above
  4. Verify that it works
  5. Close down project
  6. Start it up from scratch

Expected behavior

User condition in place

Actual behavior

No user condition in place, inspite it being saved to PC

Craft CMS version

5.1.2

PHP version

8.3

Operating system and version

No response

Database type and version

PostgreSQL

Image driver and version

No response

Installed plugins and versions

@boboldehampsink boboldehampsink changed the title [5.x]: User conditional not applied when starting project, despite it being set in the project config [5.x]: User conditional not applied when starting project, inspite it being set in the project config May 21, 2024
@i-just i-just self-assigned this May 22, 2024
@i-just
Copy link
Contributor

i-just commented May 22, 2024

Hi, thanks for reporting! I raised a PR for this.

@brandonkelly
Copy link
Member

Craft 4.9.6 and 5.1.8 are out now with that fix. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants