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

Mercure Publish fails if expression returns bool false #3681

Closed
dennobaby opened this issue Aug 24, 2020 · 1 comment
Closed

Mercure Publish fails if expression returns bool false #3681

dennobaby opened this issue Aug 24, 2020 · 1 comment

Comments

@dennobaby
Copy link

API Platform version(s) affected: 2.5

Description
Mercure Publish fails if an expression is used which could return false:
The value of the "mercure" attribute of the "MyClass" resource class must be a boolean, an array of options or an expression returning this array, "boolean" given.'

How to reproduce

/**
  * @ApiResource(
  *    mercure="object.mercure()"
  * )
  */
class MyClass
{
[...]
    private function mercure(){
        return false;
    }
}

Possible Solution
Maybe just move the if-clause in

after the expression-evaluation in

@stephanvierkant
Copy link
Contributor

I'm having the same problem. I'll try to create a PR.

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

No branches or pull requests

3 participants