Lind
Problem in the format_money helper
This might help: https://filamentphp.com/docs/3.x/panels/getting-started#casting-the-price-to-an-integer
6 replies
adding trait Translatable will make all fields Translatable
What if you implement the small fix i suggested here https://discord.com/channels/883083792112300104/1133478284676562974/1137157678511177838
into the original save function in the PR?
79 replies
adding trait Translatable will make all fields Translatable
The solution I just wrote is not the one Dan made a PR for.
The PR fixes the swapping between languages.
The second one I posted here is to avoid other forms overwriting non-translatables.
But I'm gonna look deeper into it tomorrow because the CreateRecord trait seems to be written as intended
79 replies
adding trait Translatable will make all fields Translatable
Yea, my solution copied it out to all languages but copying from old to new is probably quicker incase you have alot of languages and non translateable fields i guess. I did it after the validate in edit, not sure if thats the correct place 🙂
79 replies
adding trait Translatable will make all fields Translatable
So after more testing, i figured the solution was in updatedActiveLocale on EditRecord/Translatable and after finding a solution there i went looking at CreateRecord, where theres already implemented a solution. So i guess you could just copy that on to EditRecord
79 replies
adding trait Translatable will make all fields Translatable
Yea, and i don't think its implemented in filament anyway. But i was just thinking you could then update the other forms when you swapped language with data from the DB. But i'm not knowledgeable enough on either livewire or filament for it. Already out of my depth here
79 replies
adding trait Translatable will make all fields Translatable
If i dump the $data in the save() function i can see an array with all the languages as keys and the data from their forms, changing a non-translatable field in 1 form doesn't change it in all forms.
I don't know if this is the right bevaviour, but its what i've seen in my own code and when i run the repo linked earlier.
The issue with the fix niels provides assumes you're still on the language you changed the non-translatable field when you hit save. If you're not, it'll still override it with what was in the last form.
79 replies
adding trait Translatable will make all fields Translatable
I'm also struggling with this and i think the root cause is each language is its own form? So if you don't change the non-translatable field in the last language that is what is gonna stick in the database?
I'm working on disabling all non translatable attributes on all languages but the default one and then override the other forms with the data from the default language form. But thats alot of checks xD
79 replies