Closed widdydev closed 5 months ago
I am posting this same message across all Spatie Translatable issues & PRs
Hey all! Wanted to update you on where we're at with the translatable plugin.
I really appreciate your patience while this issue has been active. While I created the plugin for the community, I've never actually had a project where I needed to use it, and that's the same for the rest of the Filament team. As such, it's the reason why the plugin hasn't had as much attention as the others, and is much more unstable: I just don't have the environment to test all the use cases, nor the motivation to make it truly great.
As such, I put out a post a month ago and asked who in the community uses the plugin and has knowledge of plugin development. Luckily, Lara Zeus and Mohamed Sabil stepped forward, who are both authors of popular Filament plugins and are trusted by the community.
We are strongly considering handing over maintenance of the plugin to those developers, for the good of the community. You can find their fork at https://github.com/lara-zeus/translatable.
Since the new developers have lots of experience with the plugin and active projects that use it, they should be able to help debug issues easier and make a much more stable experience for other users.
If their work goes well until v4 is released, we will likely retire the plugin at that point and recommend the fork as an official replacement. If it does not go as expected and the community is unhappy, then we will reconsider this decision. I am closing this for now, and if we decide to take maintenance back officially then we will probably reopen it.
The existing plugin will continue to receive security updates indefinitely. Please let me know if you have any further questions.
Many thanks, Dan
this an attempt to fix the issue if anyone willing to test this PR I would appreciate the feedback.
this an attempt to fix the issue if anyone willing to test this PR I would appreciate the feedback.
Thanks @atmonshi for the attempt to fix. I've used your fork with the latest version, but unfortunately the PR did not fix the issue. Feel free to test/debug with my provided reproduction repository.
hey @widdydev,
can you check if this will fix your issue.
I cloned your repo and did get the error table must not be accessed before initialization
but after these changes it didnt appears, tried to refresh many times an go back and the error is gone :)
hey @widdydev, can you check if this will fix your issue. I cloned your repo and did get the error
table must not be accessed before initialization
but after these changes it didnt appears, tried to refresh many times an go back and the error is gone :)
Hi @atmonshi , thanks for your effort so far.
You're right, by adding the LocaleSwitcher
to the RelationManager
, the error is gone. Unfortunately this is a different usecase and is not desired in that case.
In my scenario the user selects the locale on the top of the page and all the subsequent/nested models should inherit this locale and output the values in the same locale without the need to select the locale again.
According to the official docs, it is possible to achieve that by adding the reactive activeLocale
attribute to the Relationship manager.
Please reopen that issue.
Package
filament/spatie-laravel-translatable-plugin
Package Version
v3.2.80
Laravel Version
v11.7.0
Livewire Version
v3.4.12
PHP Version
PHP 8.3.0
Problem description
When I navigate to the edit page of a resource that uses a RelationManager, that inherits the activeLocale from the resource, in combination with the
FileUpload('image)->image()->imageEditor()
form schema I'm receiving the error:Typed property Filament\Resources\RelationManagers\RelationManager::$table must not be accessed before initialization
Expected behavior
No error at all.
Steps to reproduce
Create 2 related models that both use the
HasTranslations
trait. Set up aRelationManager
that uses theTranslatable
trait in combination with the inheritance of theactiveLocale
described like here.This RelationshipManager will then be added to the relationships in the associated filament resource.
The parent resource that will use that RelationManger should have a
FileUpload('image)->image()->imageEditor()
field defined in the form schema.Then navigate to the EditPage of the parent resource and change the locale via the provided LocaleSwitcher action a few times. After that hit F5 to refresh the page and immediately get the error.
This error also occurs from time to time even without refreshing the page, just by navigation around different edit pages of the parent resource.
Reproduction repository
https://github.com/widdydev/filament-translatable-image-issue
Relevant log output
No response