-
Notifications
You must be signed in to change notification settings - Fork 10
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
[Bug]Translatable revisions #19
base: main
Are you sure you want to change the base?
Conversation
BOOM! Your first PR with us, thank you so much! Someone will take a look at it shortly. Please keep in mind that:
Thank you! -- |
@tabacitu i picked up @guleswine idea from Laravel-Backpack/CRUD#16 of parsing the translatable fields. I did that behind a configuration because some people might want to see the db raw value. We could improve this by parsing translations as default behaviour and having a link or something that on click display the raw json or something like that. |
@pxpm I just tried testing this, but it didn't work for me. It calls upon a Here's how I tested:
Result - 4 things now show up as having been changed - name, details, features and extras: Which is unfortunate but... let's focus on the CleanShot.2022-05-03.at.09.19.30.mp4I looked through CRUD in the hope that a PR there will have this |
PS. This PR seemed a lot cleaner - #16 - what does PR 19 do, that PR 16 doesn't do, that justifies the extra complexity? That PR didn't work in my tests either, it throws an error when I load the "revisions" page - https://flareapp.io/share/xmN0WL37#F61 |
I found a missed case in my PR, when inside the translated value, contains an object of attributes your commit should be something like
|
WHY
BEFORE - What was wrong? What was happening before this PR?
RevisionOperation didn't take into account translatable attributes so it would attempt to save the whole translations inside a single translation key when restoring. Reported in: #20
AFTER - What is happening after this PR?
The translations are re-created from the old saved translations and manually assigned.
HOW
How did you achieve that, in technical terms?
Manually set back the translation when restoring the entry attribute
Is it a breaking change or non-breaking change?
I don't think it's a breaking change, this was not properly working after all.
How can we test the before & after?
Save a value for a translatable attribute that is using revisions, try to restore that value.