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

Conditions in v10.6.2 #19757

Closed
terafirmanz opened this issue Sep 22, 2023 · 4 comments · Fixed by #19799
Closed

Conditions in v10.6.2 #19757

terafirmanz opened this issue Sep 22, 2023 · 4 comments · Fixed by #19799
Assignees
Labels

Comments

@terafirmanz
Copy link

Describe the Bug

After upgrading to v10.6.2 from 10.6.1 all conditions on fields no longer show in the UI and any new ones don't function.

To Reproduce

Upgrade to v10.6.2 and create a new condition that hides a field. the rule will not apply when triggered.

Also go to a field that does have a condition and edit it. Under conditions, none will be shown.

Downgrade to 10.6.1 and all existing conditions show again but any created under version 10.6.2 now show with this error:
image

Directus Version

v10.6.2

Hosting Strategy

Self-Hosted (Docker Image)

@terafirmanz
Copy link
Author

terafirmanz commented Sep 22, 2023

FYI the field that error is shown for has nothing to do with a repeater other than that there is a repeater on in the same collection.

Also notice that the first condition created after the downgrade gets wiped and has to then be deleted and re-added before the conditions start to work again.

@paescuj paescuj self-assigned this Sep 22, 2023
@DanielBiegler

This comment was marked as off-topic.

@Pachat

This comment was marked as duplicate.

@paescuj
Copy link
Member

paescuj commented Sep 25, 2023

Hey there 👋

The issue has been fixed in #19799 which has been released in v10.6.3.

If you've added or edited Field Conditions under v10.6.2 you need to manually adjust the value. Note that no other versions are affected by this!

You are affected if the following message appears in the "Conditions" tab under the Field Settings, after upgrading to v10.6.3:

In this case, for the affected Conditions, open the Field Menu (1) and click on "Edit Raw Value" (2):

The following dialog will appear:

Now, in the Raw Editor remove the following part at the beginning (up to but not including the [ character)

{
    "conditions":

and the following character at the end

}

then click on "Done". (See also the full example below)

After that the conditions work again as usual!

Show Example

Before

{
    "conditions": [
        {
            "name": "my-condition",
            "rule": {
                "_and": [
                    {
                        "example_field": {
                            "_contains": "example"
                        }
                    }
                ]
            },
            "readonly": true,
            "options": {}
        }
    ]
}

After

[
    {
        "name": "my-condition",
        "rule": {
            "_and": [
                {
                    "example_field": {
                        "_contains": "example"
                    }
                }
            ]
        },
        "readonly": true,
        "options": {}
    }
]

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants