-
Notifications
You must be signed in to change notification settings - Fork 88
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
String segments resests after synchronizing translations #838
Comments
After further analysis, I identified the root cause of a data inconsistency issue during the synchronization process. The issue occurs because wagtail_localize_stringsegment entries are being reinserted instead of being retrieved from the database, and not all segments are inserted as expected. This leads to a mismatch between wagtail_localize_stringtranslation.translation_of_id and wagtail_localize_stringsegment.string_id. This query run for almost all segments INSERT INTO `wagtail_localize_stringsegment` (`source_id`, `context_id`, `order`, `string_id`, `attrs`)
VALUES (1597, 16609, 52, 29431, 'null'); SQL Query to Retrieve Translations:The following query retrieves translations for string segments: SELECT
`wagtail_localize_stringsegment`.`id`,
`wagtail_localize_stringsegment`.`source_id`,
`wagtail_localize_stringsegment`.`context_id`,
`wagtail_localize_stringsegment`.`order`,
`wagtail_localize_stringsegment`.`string_id`,
`wagtail_localize_stringsegment`.`attrs`,
(
SELECT
U0.`data`
FROM
`wagtail_localize_stringtranslation` U0
WHERE
U0.`context_id` = `wagtail_localize_stringsegment`.`context_id`
AND U0.`locale_id` = 2
AND U0.`translation_of_id` = `wagtail_localize_stringsegment`.`string_id` --at this line filtering fails
AND NOT U0.`has_error`
) AS `translation`,
`wagtail_localize_translationcontext`.`id`,
`wagtail_localize_translationcontext`.`object_id`,
`wagtail_localize_translationcontext`.`path_id`,
`wagtail_localize_translationcontext`.`path`,
`wagtail_localize_translationcontext`.`field_path`,
`wagtail_localize_string`.`id`,
`wagtail_localize_string`.`locale_id`,
`wagtail_localize_string`.`data_hash`,
`wagtail_localize_string`.`data`
FROM
`wagtail_localize_stringsegment`
INNER JOIN `wagtail_localize_translationcontext`
ON `wagtail_localize_stringsegment`.`context_id` = `wagtail_localize_translationcontext`.`id`
INNER JOIN `wagtail_localize_string`
ON `wagtail_localize_stringsegment`.`string_id` = `wagtail_localize_string`.`id`
WHERE
`wagtail_localize_stringsegment`.`source_id` = 1597; |
I am encountering an issue where some string segments reset after synchronizing and publishing translations. Specifically:
Only certain pages are affected, and within those pages, only some strings reset.
The resetting string segments are being re-inserted into the wagtail_localize_stringsegments table after synchronization.
Other pages and string segments of same page model work as expected without issues.
Environment:
This is how i created page
The text was updated successfully, but these errors were encountered: