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

Fix translated medias in settings #620

Closed
wants to merge 3 commits into from

Conversation

smeeckaert
Copy link
Contributor

Hi,

It looks like using a medias field with the configuration key twill.media_library.translated_form_fields = true in the settings doesn't work at all.

I've fixed two issues to allow medias in settings to be localized.

  1. There was a bug in the MediaField vue component, when used in a setting page the field name image[en] would be translated to medias[image[en]][0] which doesn't work. My fix changes it to a working medias[image][en][0].

I don't know if there is any side effects to this changes but I think not. I've tried every instance of this component on my relatively small website and everything works as intented.

  1. I've updated the SettingRepository to work with localized medias if the twill.media_library.translated_form_fields configuration key is set to true.

These changes would probably break the translated medias on websites with the twill.media_library.translated_form_fields activated but like I said it doesn't work at all at the moment so it shouldn't be much of an issue.

@CLAassistant
Copy link

CLAassistant commented Apr 5, 2020

CLA assistant check
All committers have signed the CLA.

@marinaglancy
Copy link
Contributor

marinaglancy commented Jul 2, 2020

Hi! I just commented on #87 -
in MediaField.vue you should use this.mediaKey instead of this.name, otherwise it does not work with multiple medias

@ifox ifox closed this in e036313 Jul 7, 2020
marinaglancy added a commit to marinaglancy/twill that referenced this pull request Jul 18, 2020
marinaglancy added a commit to marinaglancy/twill that referenced this pull request Jul 18, 2020
ifox pushed a commit that referenced this pull request Jul 20, 2020
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

Successfully merging this pull request may close these issues.

4 participants