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

[9.x] Fix ViewErrorBag for JSON session serialization #42090

Merged
merged 3 commits into from
Apr 22, 2022

Conversation

Krisell
Copy link
Contributor

@Krisell Krisell commented Apr 22, 2022

The json session serialization format added in Laravel 9 (#40595) doesn't work for flashed validation errors since those are serialized from the ViewErrorBag instance. ViewErrorBag does not implement JsonSerializable and more importantly need to be recreated when reading the session data back.

This PR intends to resolve this by storing the necessary information as an array, and rehydrating the instance after reading the session data back. This tries to implement the suggestion by Taylor here: laravel/laravel#5796 (comment)

Note that this changes nothing unless $serialization === 'json'.

Fixes #40773
Related to #41850

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

Successfully merging this pull request may close these issues.

Validation errors are always empty in Laravel 9.x-dev
2 participants