odoo/odoo#264152
Created by fw-bot
Merged
at 6e7dc94e84fcdd9d3d0c57a1e755471cd1d972fa
Statuses:
- legal/cla: Contributor License Agreement check
- ci/runbot: Odoo Test Suite
- ci/upgrade_enterprise: Test upgrades for enterprise master
- ci/template: (runtime 1336s)
- ci/style: Optional style check. Ignore it only if strictly necessary.
- ci/security: Required security check. Can only be ignored by security team.
- ci/l10n: (runtime 17s)
- ci/documentation: (runtime 1228s)
- ci/design-theme: (runtime 1924s)
- label
- odoo-dev:saas-19.3-saas-18.4-opw-5950228-toc_html_style-sben-525872-fw
- head
- 23dcb1f54209a1c23d82c525b54eef5afdca5761
- merged
- 3 days ago by Saif Allah Ben Khalil (sben)
| odoo/odoo | |
|---|---|
| saas-18.4 | #260378 |
| 19.0 | #263161 |
| saas-19.1 | #263547 |
| saas-19.2 | #264086 |
| saas-19.3 | #264152 |
| master | #265483 |
[FIX] website: update table of content navbar when heading style changes
Steps to reproduce:
- Enable a second language on the website
- Add a Table of Content snippet to a page
- Apply bold (or any inline style) to one of the headings, save
- Switch to the second language in translation mode
- Translate the styled heading and save
=> The TOC navbar entry keeps showing the source text on reload.
=> Expected: navbar shows the translated heading text, unstyled.
Cause:
When a TOC heading carries inline markup, the server emits the
heading and the navbar entry as two independent translation terms
with different data-oe-translation-source-sha values, even though
their textContent matches. A translation written under the heading's
sha therefore never reaches the navbar's slot.
handleToC was meant to bridge that by aliasing the navbar span's
sha to the heading's during translation-mode setup, but two issues
prevented it from working in saas-18.4+:
- The TOC navbar lives under
.o_not_editable, so its translation
spans were excluded fromfindOEditableandhandleToCnever
ran on them. The classo_translation_without_stylewas never
added, and the sha was never aliased.
Solution:
prepareTranslationiterates TOC navbar translation spans
explicitly, sohandleToCreaches them despitefindOEditable
skipping.o_not_editable.handleToCalways tags the navbar span with
o_translation_without_stylewhen a matching heading exists.- An
after_replication_handlershook flags every replicated
unstyled-translation target as.o_dirty, so the replicated
translation is included in the save.