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

[4.x] Fix tables in Bard not saving updates #9867

Merged
merged 1 commit into from Apr 11, 2024

Conversation

jacksleight
Copy link
Contributor

@jacksleight jacksleight commented Apr 11, 2024

Fixes #9860

This was caused by the change in #9788.

Tiptap isn't (always?) creating new objects when onUpdate fires or getJSON is called, so after the first update oldJson is exactly the same object as json, the comparison passes, and no further updates are fired.

This wasn't a problem before #9788 because it was comparing against this.value which was already stringified in the previous update.

@jacksleight jacksleight changed the title Fix tables in Bard not saving updates [4.x] Fix tables in Bard not saving updates Apr 11, 2024
@jasonvarga
Copy link
Member

You're a clever guy

@jacksleight
Copy link
Contributor Author

Ha, it made my head melt a bit 🫠 .

@jacksleight
Copy link
Contributor Author

jacksleight commented Apr 11, 2024

Still a bit of a mystery why this is only happening with table fields. Seems like it should happen with all fields but it doesn't... weird.

@robdekort
Copy link
Contributor

Amazing Jack! Thanks for this! @websmyth kept suggesting this was all my fault.

@websmyth
Copy link

Flipping heck, @jacksleight - amazing work!

@robdekort I'm still blaming you, ok 😂

@jacksleight
Copy link
Contributor Author

jacksleight commented Apr 11, 2024

Sorry @websmyth, turns out it was my fault! But I'm happy for you to blame @robdekort 😄 .

@jasonvarga I'm wondering if there might be another way to handle all this in v5 with the other json encoding changes. I might look at that separately.

@robdekort
Copy link
Contributor

giphy

@jasonvarga jasonvarga merged commit 28b09bd into statamic:4.x Apr 11, 2024
24 checks passed
@jacksleight jacksleight deleted the fix/bard-table-input branch April 11, 2024 18:48
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.

Tables in Bard sets only save partial data
4 participants