Translatable fields in Form Screens not populating existing values
i am using spatie/laravel-translatable with json fields in translation.
afer upgrading from 14.38.0 to 14.43.1, Tables with TD::make('title.tr', __('Title')) needs to be TD::make('title', __('Title')), that can be done by find and replace no problem.
But in form screens, Input::make('paymentGateway.name.'.$locale) is now cannot populate existing tr,en,etc.. translation of the name field. That will be a lot of massive code refactor (because of dynamically adding new languages), and thus cannot be done by design.
this is because of : https://github.com/orchidsoftware/platform/pull/2921/commits/e13b5d31e6463ae98f78e4cd3e78a68235de83bd
Should i use AsMultiSource instead of AsSource?
nope, it has only 1 json field. I Have to override AsSource. Wish me luck if there will not be any class_uses_recursive usage of this class.
If I understand things correctly, after making some changes to improve performance, the fields with cast to json/array stopped working.
This wasn't something we anticipated, but I don't want to break compatibility. My plan is to either roll back the changes or find a way to keep dot notation support for those fields. I'll also make sure to write a test for it.
If you have some time and are up for helping out, I'd really appreciate it!
You did improved the performance for sure. But spatie/translatable are not provided by array. They are being used by ->attribute so i implemented the old AsSource in my App/Traits directory and used them in my models instead of orchid's, nothing broken for now.
There is nothing to do for now i think. You may only maintain old "AsSource" or give the new one name as "AsSourceFromArray" or sth.
i dont see any other option here.
I appreciate to help, but no need i think.