Skip to content

Conversation

@wachterjohannes
Copy link
Member

@wachterjohannes wachterjohannes commented Apr 8, 2025

The $this->expressionLanguage->evaluate($condition, $object); expect only a array.

declare(strict_types=1);

/*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
declare(strict_types=1);
/*
/*

@wachterjohannes wachterjohannes force-pushed the hotfix/field-evaluator branch from 1a6a409 to 903207e Compare April 8, 2025 12:38

public function evaluateCondition($object, string $condition)
{
if (!\is_array($object)) {
Copy link
Member

@alexander-schranz alexander-schranz Apr 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the object should be an array and not an object? what is the issue you try to solve here?

The variable is called object so I think it should handle also objects not only arrays

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the function can be called with any type and the expression language requires an array - so returning false

@wachterjohannes wachterjohannes force-pushed the hotfix/field-evaluator branch from 903207e to e10c933 Compare April 8, 2025 12:45
@alexander-schranz alexander-schranz merged commit ff511ce into massiveart:2.9 Apr 8, 2025
4 of 8 checks passed
@wachterjohannes wachterjohannes deleted the hotfix/field-evaluator branch April 8, 2025 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants