-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Commit introduced breaking changes #77
Comments
@tasinttttttt Yes, but I think it's wrong before: Before $post = Post::create(['title' => 'version1', 'content' => 'version1 content']);
$post->update(['title' => 'version2', 'extends' => ['foo' => 'bar']]);
dd($post->versions[1]->contents['extends']);
# output
array:1 [
"foo" => "bar"
] when we revert the version, it will cause the error: dump($post->versions[1]->revert(), $post);
// TypeError: json_decode(): Argument #1 ($json) must be of type string, array given After $post = Post::create(['title' => 'version1', 'content' => 'version1 content']);
$post->update(['title' => 'version2', 'extends' => ['foo' => 'bar']]);
dd($post->versions[1]->contents['extends']);
# output
"{"foo":"bar"}" dump($post->versions[1]->revert(), $post->extends);
# output
array:1 [
"foo" => "bar"
] So, I think it would be ok if you have any questions please let me know, and I will try my best to fix it. |
By "Before", do you mean v4.4.0 or versions before 4.4.0 ? Also, don't you think the mentioned failing test in 4.x should at least be updated to show the expected behavior? |
Versions >4.4 have a merged commit which introduced a breaking change (with tests not passing with the breaking change).
An example is found in the Feature test
post_can_revert_to_target_version
In the tests, there's a json field called
extends
which is cast as an array. With the change introduced here, the cast is not taken into account:Makes me think of the merge process, I don't think tests are run before merging right?
Originally posted by @tasinttttttt in #50 (comment)
The text was updated successfully, but these errors were encountered: