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

Don't work config guards #78

Open
4n70w4 opened this issue Apr 13, 2020 · 2 comments
Open

Don't work config guards #78

4n70w4 opened this issue Apr 13, 2020 · 2 comments

Comments

@4n70w4
Copy link

4n70w4 commented Apr 13, 2020

symfony/workflow v4.4.2

https://symfony.com/doc/4.4/workflow.html#blocking-transitions

        'transitions' => [
            'work'=> [
                'guard' => 'subject.canWork()',
                'from' => 'draft',
                'to' => 'work',
            ],
    public function canWork() {
        return false;
    }
$e = Test::find(34089);

$e->workflow_can('work');
// true

$e->workflow_apply('work');
dump($e->status);
//    "status" => "work"

But this method does not call and completely ignores.

@4n70w4
Copy link
Author

4n70w4 commented Apr 13, 2020

symfony/workflow@5669634

@4n70w4
Copy link
Author

4n70w4 commented Apr 17, 2020

If you do not want to make support for such a configuration, then at least throw an exception that this is not supported. I had to spend the whole evening to understand why it does not work.

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

1 participant