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 with initial translated content #2001

Closed
lukaskleinschmidt opened this issue Aug 12, 2019 · 3 comments

Comments

@lukaskleinschmidt
Copy link
Contributor

commented Aug 12, 2019

Describe the bug
Under certain conditions translated content files contain not translatable fields.

To Reproduce
Steps to reproduce the behavior:

  1. Install the startkit
  2. Add a second language
  3. Make some fields not translatable (e.g. the date and author field in the note blueprint)
  4. Navigate to a note in the panel and switch to the secondary language
  5. Edit the title or change the slug
  6. The created content text file will include both the date and author field

As far as I can tell this bug only occurs if you just change the title or slug of a not yet created translation. As soon as you save any "real" fields the content file gets sanatized as expected.

Expected behavior
The date and author field should not end up in the translated content file.

Kirby Version
3.2.3

Desktop (please complete the following information):

  • Windows 10
@distantnative

This comment has been minimized.

Copy link
Contributor

commented Sep 11, 2019

Initial thought: sounds like the non-translatable field values still end up in the Vuex store and are written as content file anyways, when triggering changeTitle or changeSlug.

@lukaskleinschmidt

This comment has been minimized.

Copy link
Contributor Author

commented Sep 12, 2019

Actually I don't think this is a vue problem at all. As far as I remember the problem I found was that the content only gets sanatized when editing content fields (using the update() and in the end the save() method with $overwrite = true).
The changeSlug() or changeTitle() methods don't handle sanatization at all and so the not translated fields end up (do net get sanatized afterwards) in the content file when the file gets created.

@distantnative distantnative added this to the 3.2.5 milestone Sep 13, 2019
bastianallgeier added a commit that referenced this issue Sep 13, 2019
@bastianallgeier bastianallgeier referenced this issue Sep 13, 2019
2 of 3 tasks complete
bastianallgeier added a commit that referenced this issue Sep 16, 2019
@bastianallgeier

This comment has been minimized.

Copy link
Contributor

commented Sep 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.