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

Handle text field clearing when syncing #495

Merged
merged 1 commit into from
Dec 17, 2021

Conversation

zerolab
Copy link
Collaborator

@zerolab zerolab commented Dec 13, 2021

Fixes #467

tl;dr - we mark text fields and StreamFields as TranslateableField, but only flag StreamFields as needing syncing. When the value is removed, there is nothing to tell Translation.create_or_update_translation() that this has happened.

Translation._get_segments_for_translation() only return translateable fields that have values in them, so nothing will happen via ingest_segments

@codecov-commenter
Copy link

Codecov Report

Merging #495 (eb950c9) into main (297e5ed) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #495   +/-   ##
=======================================
  Coverage   92.82%   92.83%           
=======================================
  Files          36       36           
  Lines        2983     2985    +2     
  Branches      467      468    +1     
=======================================
+ Hits         2769     2771    +2     
  Misses        114      114           
  Partials      100      100           
Impacted Files Coverage Δ
wagtail_localize/fields.py 91.07% <100.00%> (+0.16%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 297e5ed...eb950c9. Read the comment docs.

@zerolab zerolab requested a review from kaedroho December 13, 2021 17:28
Copy link
Contributor

@chris48s chris48s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think my 👍 counts for anything on this repo but LGTM

@zerolab zerolab removed the request for review from kaedroho December 16, 2021 10:02
@zerolab zerolab merged commit 62c5593 into wagtail:main Dec 17, 2021
@zerolab zerolab deleted the chore/sync-cleared-text-field branch December 17, 2021 12:59
@zerolab zerolab added this to the 1.1 milestone Jan 5, 2022
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.

Frontend on synchronised pages still shows deleted fields
3 participants