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

[Workflow] No hard dependency to expression language component #32512

Closed
rmikalkenas opened this issue Jul 12, 2019 · 11 comments
Closed

[Workflow] No hard dependency to expression language component #32512

rmikalkenas opened this issue Jul 12, 2019 · 11 comments

Comments

@rmikalkenas
Copy link
Contributor

rmikalkenas commented Jul 12, 2019

Symfony version(s) affected: 4.3.2

Description
Running composer require workflow on a project which doesnt have expression language component throws exception The "Symfony\Component\Security\Core\Authorization\ExpressionLanguage" class requires the "ExpressionLanguage" component. Try running "composer require symfony/expression-language".

How to reproduce
https://github.com/rmikalkenas/workflow-issue

Possible Solution
Move symfony/expression-language dependency in workflow component from require-dev to require

Additional context
PHP 7.3.2

Screenshot from 2019-07-17 09-02-08

@xabbuh
Copy link
Member

xabbuh commented Jul 13, 2019

I am not able to reproduce this issue. Can you create a small example application that allows us to do so?

@lyrixx
Copy link
Member

lyrixx commented Jul 14, 2019

I guess you are using a guard expression ?

@rmikalkenas
Copy link
Contributor Author

I'm not using expressions, bus the project uses fos rest bundle, maybe it uses.. I will try to investigate and create an example app.

@rmikalkenas
Copy link
Contributor Author

Ok, I have managed to reproduce the exception: https://github.com/rmikalkenas/workflow-issue

Looks like the problem is in Symfony\Component\DependencyInjection\Compiler\AutowirePass::createTypeNotFoundMessageCallback which uses container which has workflow.security.expression_language service.

Correct me if I'm wrong..

@lyrixx
Copy link
Member

lyrixx commented Jul 16, 2019

@nicolas-grekas I don't really understand this issue. This is not really related to the workflow. Could you have a look? Thanks

@rmikalkenas
Copy link
Contributor Author

rmikalkenas commented Jul 16, 2019

Indeed, its more related to security bundle and DI. At first i thougt it was related to workflow, because exception started when i installed workflow component and created models. But after investigation it looks like I was wrong

@lyrixx
Copy link
Member

lyrixx commented Jul 16, 2019

Yes, it's really weird. It occurs when Symfony try to load this file

namespace Symfony\Component\Workflow\EventListener;

use Symfony\Component\Security\Core\Authorization\ExpressionLanguage as BaseExpressionLanguage; // HERE
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Symfony\Component\Workflow\Exception\RuntimeException;

class ExpressionLanguage extends BaseExpressionLanguage
{

If I comment the line with // HERE, it works well

So I have two questions:

  • Why does symfony try to load this file ?
  • Why is there an exception when loading this other file ?

IMHO, there is 2 issues to fix here


Note: It reminds me #31535

@xabbuh
Copy link
Member

xabbuh commented Jul 16, 2019

Can you show the full stack trace? Maybe the same root cause as #32395?

@rmikalkenas
Copy link
Contributor Author

rmikalkenas commented Jul 17, 2019

PHP 7.3.2

Screenshot from 2019-07-17 09-02-08

@nicolas-grekas
Copy link
Member

nicolas-grekas commented Jul 17, 2019

Duplicate of #32395

@nicolas-grekas nicolas-grekas marked this as a duplicate of #32395 Jul 17, 2019
@lyrixx
Copy link
Member

lyrixx commented Jul 17, 2019

Thanks @nicolas-grekas and @xabbuh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants