Skip to content

Error in sidebar when using conditions to show/hide field #3054

@JoeriE

Description

@JoeriE

Bug Description

I've a collection with two linked taxonomies. One taxonomy should only be visible if the other collection has a certain value, example:
Expertise categories has entries: expertise, news and projects
Expertise tags should only be visible if expertise categories has value expertise.

I've added this as a condition in the cp:

image

But then the sidebar breaks because of an javascript error:
Sidebar before
image

Sidebar after
image

Javascript error
SyntaxError: Unexpected token ':' at _default.passesCondition (Validator.js:209) at Validator.js:62 at underscore.js:926 at underscore.js:255 at Function.v.each.v.forEach (underscore.js:186) at Function.v.filter.v.select (underscore.js:254) at Function.v.reject (underscore.js:262) at v.each.v.<computed> [as reject] (underscore.js:1639) at _default.value (Validator.js:62) at _default.value (Validator.js:33)

Environment

Statamic 3.0.36 Pro
PHP 7.4.12

Install method (choose one):

  • Fresh install from statamic/statamic

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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