Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Non Translatable Medias are not displayed on reload, but saved in the database. #814

Closed
Keimeno opened this issue Apr 1, 2021 · 7 comments

Comments

@Keimeno
Copy link
Contributor

Keimeno commented Apr 1, 2021

I have the following setup: My Twill instance supports both German (de) and English (en), with German being the default language.

When I create the following non-translatable media field:

@formField('medias', [
  'name' => 'myImage',
  'label' => 'My Image',
  'required' => true,
  'translated' => false,
])

I am able to add an image and save it. It will also be saved in the database, but under the locale en.

If I reload the page the image is not displayed any more. It seems that the mediaKey variable inside the MediaField.vue is prioritizing the locale en, instead of the default locale: de.

@Keimeno
Copy link
Contributor Author

Keimeno commented Apr 1, 2021

I can take a closer look into this problem in the next couple of days and potentially open a PR regarding this issue.

@Keimeno
Copy link
Contributor Author

Keimeno commented Apr 1, 2021

One potential fix would be to save the images under the current default language (in my case de). This would, however, cause a problem, when changing the default language.

A better fix would be to deprecate using a locale all together, or defining a placeholder locale, that doesn't/couldn't exist.

@daun
Copy link
Contributor

daun commented Apr 6, 2021

Duplicate of #483.

@ConstantMath
Copy link

ConstantMath commented Apr 20, 2021

Same issue here.
I bypass it by using : 'translated' => true, in the @formField so the image appears in the form.

@ConstantMath
Copy link

Another bug related to the translated medias is that the Notes and FieldNotes don't appear when the media formField is set on 'translated' => true.

@Keimeno
Copy link
Contributor Author

Keimeno commented Apr 20, 2021

@ConstantMath the bypass sadly doesn't work if the model, it is being saved to, is non-translatable by default.

@ptrckvzn
Copy link
Member

Thanks for reporting this bug. I will close it as it's a duplicate of #483.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants