-
Notifications
You must be signed in to change notification settings - Fork 46
Attachments not working when Froala field is translatable #26
Comments
Hi! Haven't experience with |
It does not work with Trix editor by default, however there is a workaround (as posted here) for Trix:
This does the job. When I try exactly the same with Froala, although the file is temporarily uploaded/stored (both in the filesystem and nova_pending_froala_attachments db table), when I click the "update/save" button in my nova resource, the file is deleted from filesystem and also nova_pending_froala_attachments table (without creating a new entry to nova_froala_attachments). As it seems, the problem lies on spatie/laravel-translatable and spatie/nova-translatable packages end. Half the job is done here, since the file is saved in the filesystem and also in the temporary db table, something happens in the final steps... |
Feel free to make a PR with |
This is what I ended up doing for a temporary workaround: In Froala.php I modified fillAttribute() method as following:
Actually, I moved attachment handling to the beginning of fillAttribute() method, so that attachments are saved/handled before any other modifications are done to the field (for example by Translatable class). Of course this could not be a permanent solution, but seems like the only way to make it work at the moment. |
Same issue with Nova Flexible Content. |
Vou fazer uma PR, é fácil de resolver. Ou pode até mesmo, identificar o translatabe no método META[] e se existir remover os caracteres terminandos com pontos no final antes de adicionar na busca e do filtro. |
works for me |
Hello,
I am using spatie/laravel-translatable to have my models translatable, and also spatie/nova-translatable to manage the translatable fields through Nova.
When using Froala field alone, like this:
everything works fine.
However, when I combine it with Translatable field:
attachments don't work anymore.
Dev tools inspector shows the following error:
POST http://site.local/nova-vendor/froala-field/pages/attachments/translations_body_en 404 (Not Found)
I guess that field here should be just "body", but due to translatable package it becomes "translations_body_en"?
Is it, by any chance, possible to fix the compatibility between the two packages?
Thanks in advance,
Ilias
The text was updated successfully, but these errors were encountered: