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

Regression on story states for non object state #697

Closed
Brewal opened this issue Oct 2, 2024 · 0 comments · Fixed by #699
Closed

Regression on story states for non object state #697

Brewal opened this issue Oct 2, 2024 · 0 comments · Fixed by #699

Comments

@Brewal
Copy link
Contributor

Brewal commented Oct 2, 2024

Since 2.0.5, story states seems to be broken for any values added with addState that are not objects.

addState allows mixed type, however in the getState method, we now call a refresh on PersistenceManager that expect an object. Hence the error in my case :

TypeError: Zenstruck\Foundry\Persistence\PersistenceManager::refresh(): Argument #1 ($object) must be of type object, array given, called in /srv/api/vendor/zenstruck/foundry/src/Story.php on line 140

return Configuration::instance()->persistence()->refresh($this->state[$name], force: true); // @phpstan-ignore argument.templateType

Brewal added a commit to Brewal/foundry that referenced this issue Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant