Repeater relationship translation not working
When you use repeater relationship translations the relationships does not save per locale, and when switching locale it crashes sometimes.
See: https://share.cleanshot.com/b7gdrBZk
84 Replies
Is this fixed? @Dan Harrin Can i maybe help with this
please stop @ing me, there is no system of priority between bug reports for non-sponsors, especially for bug reports that havent been properly filed on github
you can always submit a PR if you want to help
It has been filed on github, 21 september by someone else, is this filed correctly?
https://github.com/filamentphp/filament/issues/8656
GitHub
Issue with repeater and builder when saving in relation manager usi...
Package filament/spatie-laravel-translatable-plugin Package Version v3.0.57 Laravel Version v10.24.0 Livewire Version v3.0.5 PHP Version PHP 8.1.1 Problem description When attempting to save record...
Ill see if i can get it fixed, and if so, file a pr
okay, yes that issue looks fine
was this ever a feature?
the translatable plugin has always been very basic
Yes with v2 it worked, fine, with v3 almost all translationatable things are broken
Probably just a simple thing that changed or something, but i holds me to upgrade. My own features are custom and worked. before. But even translatable repeaters/relationships dont work anymore
I would be able to give you access to a repo where you can test this easily
Would i need to fix it in the translatable plugin, or in filament self?
probably in filament itself
in the translatablecontentdriver thing
Do you have an idea where this happens?
Found the problem in the spatie laravel translatable content driver, the code from the image below, in the query there are backticks added, which causes the error.
Fixed it: default => should be
in file SpatieLaravelTranslatableDriver
GitHub
Fix - Set record translations by leandrocfe Β· Pull Request #9633 Β· ...
Fixed - #8656
Changes have been thoroughly tested to not break existing functionality.
New functionality has been documented or existing documentation has been updated to reflect changes.
Visua...
What does this fix exactly? Not all problems does it?
Ill test it and confirm oke?
Please
https://github.com/filamentphp/filament/blob/3.x/packages/support/src/helpers.php#L162
What is the filament version?
GitHub
filament/packages/support/src/helpers.php at 3.x Β· filamentphp/fila...
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS. - filamentphp/filament
3.0.8
This one
we are on 3.0.93 now
there were lots of translatable issues when we first released v3
but most of those are now fixed
I probably sound stupid now, but is this incorrect then?
did you run composer update?
Yup
share the composer.json
remove "filament/forms": "^3.0" and run composer update
Still same
"laravel/framework": "^9.19" ?
Ahg i see, lemme fix that now
also
"minimum-stability": "stable",
Got it now, in the .json
This does not work yet
it never did
we have never had a feature that translates select options
But we should be able to fix this right? It was more as a reply to leandro
if not, ill just fix this with the getStateUsing function
->getOptionLabelFromRecordUsing(fn ($record) => $record->name)
is prob rightYes!
Im going to test repeaters now
PR is pending but you can try this in your local env
https://github.com/filamentphp/filament/blob/01e33e4370ecc590fff39459e8e0b4966410df1a/packages/spatie-laravel-translatable-plugin/src/SpatieLaravelTranslatableContentDriver.php
GitHub
filament/packages/spatie-laravel-translatable-plugin/src/SpatieLara...
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS. - filamentphp/filament
Yeah i filled my local file with this so i can test it, searching translated fields in the table does not work yet, but i have a fix for that
Hmmm, does not work i see: https://share.cleanshot.com/4RwgpxB6
If you want, share your repo. I can have a look
Can you maybe check the video?
When i save when set to english, it just saves the dutch version to 'en'
I tried it on this repo https://github.com/tlegenbayangali/filament-repeater-translatable-issue
GitHub
GitHub - tlegenbayangali/filament-repeater-translatable-issue
Contribute to tlegenbayangali/filament-repeater-translatable-issue development by creating an account on GitHub.
i could give you access, can you give me a github username
Addede
i see this is done with a relationManager, and not a repeater right?
yes
I cant reproduce your test because your repo isn't updated
please create a branch with your resource test, composer updates, etc..
its updated now haha
You can pull and edit master
Excuse me, i forgot it haha but fixed now
sorry, I can't test it. The project has migrations issues, this doesn't have seeders... I can help you, but you can provide a repo that I can test
Let me fix that for you
You can pull now, when you do a fresh migrate you can login with [email protected] & 123123
And then you can test this by create a Test at the TestResource
Can you test the function below, in the same file, this fixes the translatable search in tabels
i think we miss something for the repeaters in Resources > Pages > EditRecord > Concerns > Translatable
But when i add the relationship name to the $translatable array in the model, it does work π
yes, this is working, right?
Yes!
im going to test this in my big project right now to see if that works too
Can you implement my code too?
send a pr please
It is combined with your code so how do i do that? (i never did that before)
I think you can fork the repo and go to
gh pr checkout 9633
Forked it, and cloned it, but this error
Nvm got it
GitHub
Fix - Fixed translatable form search by Robinvm Β· Pull Request #964...
Fixed - #8656
Changes have been thoroughly tested to not break existing functionality.
New functionality has been documented or existing documentation has been updated to reflect changes.
Visua...
Can you check if this is okay?
i notice the builder doesnt work either, with blocks in them, they glitch when saving the second translation
i have the code below but those functions dont get called when switching locale
with the builder and group relationships in the form builder i still have the issue that when i want to save another language than the default one, the fields get cleared out. Do you have any idea where i can catch this to fix this? Id love to fix it and PR it.
open an issue with a repo to reproduce it or send a PR
Dan is going to look into it soon, will create a repo tomorrow too
I am experiencing the same issue. Have you been able to resolve it or find a solution? The project is urgent, and the project manager is frustrated
@RobinDev @Leandro Ferreira
Its fixed
Filament version?
how?
v3.0.102 last version
What is the issue? Could you share the code please?
for someone with an urgent issue you arent giving anyone much to work with π
same as this i replied to
@Leandro Ferreira
Share the code
give me your github username
i sent invite
its in ProductResource.php
add in the Product model
Oooooooo mannnn thank you so much
i cant belive all was this
good news for the project manager
yeah i was planing to remove multi lang featureπ
it would work as well π
Yeah!!
I believe it would be good to include this information in the package documentation. It's possible that others, like myself, may encounter a similar bug.
You can send a PR π
@RobinDev Question: how did you do this in the sidebar?
What is "this'"?
π Fair enough.
I meant how can you create these levels in the menu? Like a hierarchy?
It's probably a group with 3 items, where one doesn't have an Icon. I thought this only works completely without icons, tohug.