Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

HaystackBale serialization not working with PostgreSql #61

Closed
blazpezdir opened this issue Nov 14, 2022 · 5 comments
Closed

HaystackBale serialization not working with PostgreSql #61

blazpezdir opened this issue Nov 14, 2022 · 5 comments

Comments

@blazpezdir
Copy link
Contributor

blazpezdir commented Nov 14, 2022

Laravel Version: v8.83.23
PHP Version: 8.1.12
Database Driver & Version: PostgreSQL 12.4

A serialized object in PHP that has null values before private/protected fields will fail to serialize because Postgres PDO serialization will stop on null values.
Example:
"O:1:"A":1:{s:8:"\0*\0field";N;}"

We can use base64_encode before inserting & base64_decode after fetching the serialized objects.

The laravel team had the same issue for batches feature
laravel/framework#36061

@blazpezdir
Copy link
Contributor Author

This is the solution Laravel team implemented

https://github.com/laravel/framework/pull/36081/files

@blazpezdir
Copy link
Contributor Author

Fix is provided in pull request #63

@ksimenic
Copy link
Contributor

Having the same issue with PostgreSql. Looks like pull #60 and pull #63 ended in status quo since none is merged to core. Would you @Sammyjo20 consider merging this one to core and I can help with adjusting pull #60 afterwards?

@Sammyjo20
Copy link
Owner

Hey, sorry about the slowness on this issue/PR - thank you @ksimenic for consolidating the PRs, I will take a look now!

@Sammyjo20
Copy link
Owner

This is fixed in v0.12!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants