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

Argument Error - Argument 1 passed to Symfony\\Component\\Workflow\\Marking::__construct() must be of the type array, string given #68

Open
Kreateyou opened this issue Jan 18, 2020 · 7 comments

Comments

@Kreateyou
Copy link

I am getting the following error

Argument 1 passed to Symfony\Component\Workflow\Marking::__construct() must be of the type array, string given, called in vendor/symfony/workflow/MarkingStore/MultipleStateMarkingStore.php on line 47

@brexis
Copy link
Owner

brexis commented Jan 18, 2020

Hi
Can you please provide sample code?

@Kreateyou
Copy link
Author

Kreateyou commented Jan 18, 2020

Seem the error is thrown when i use any WorkflowTrai method workflow_can(),workflow_apply()

$model = Post::find(1);

$model->workflow_apply($request->get("workflow"));

$model->save();

Where request workflow is "to_review"

@brexis
Copy link
Owner

brexis commented Jan 29, 2020

Can you please add:

  • Your PHP version
  • Your Laravel Version

I'm not able to reproduce this, and it will help a lot for debugging.

@Kreateyou
Copy link
Author

Can you please add:

  • Your PHP version
  • Your Laravel Version

I'm not able to reproduce this, and it will help a lot for debugging.

Thank Brexis for reply

i am using PHP 7.2 and Lumen (6.2.0) (Laravel Components ^6.0)

@pavan-cs
Copy link

pavan-cs commented Feb 3, 2020

hey @brexis,
facing same issue, please update ASAP
PHP - 7.3
laravel 5.8

@pavan-cs
Copy link

pavan-cs commented Feb 3, 2020

@Kreateyou and @brexis

in workflow.php (config)

'marking_store' => [
            'type' => 'single_state', // 'multiple_state',
            'arguments' => ['status'],
        ],

fixed my issue, but you need to fix this issue :)

@fabien44300
Copy link

Hello,
I had the same error message with the multiple_state type (not with single_state)
To solve it with the multiple_state, you have to specify the field of your argument in your model like this :

protected $casts = [
    'status' => 'array'
];

Fabien

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

4 participants