Files
odoo_source/addons
Xavier Morel bb543d75a9 [FIX] web_editor: breaking _onBeforeUnload when canceling edition
After updating mass_mailing_snippets_menu_tabs to cancel the
template's edition at the end of the tour, the editor starts blowing
up during cleanup with:

```
Trying to set result to failed (UncaughtTypeError: Cannot read properties of null (reading 'anchorNode')
    at Sanitize._parse (/web/assets/363-d1667a2/web_editor.assets_wysiwyg.min.js:1453:105)
    at Sanitize.parse (/web/assets/363-d1667a2/web_editor.assets_wysiwyg.min.js:1450:6)
    at new Sanitize (/web/assets/363-d1667a2/web_editor.assets_wysiwyg.min.js:1448:6)
    at sanitize (/web/assets/363-d1667a2/web_editor.assets_wysiwyg.min.js:1460:53)
    at OdooEditor.cleanForSave (/web/assets/363-d1667a2/web_editor.assets_wysiwyg.min.js:1372:37)
    at Class.getValue (/web/assets/363-d1667a2/web_editor.assets_wysiwyg.min.js:2547:1121)
    at Class.isDirty (/web/assets/363-d1667a2/web_editor.assets_wysiwyg.min.js:2547:407)
    at
    _onBeforeUnload (/web/assets/363-d1667a2/web_editor.assets_wysiwyg.min.js:2509:560)
```

After consultation with the relevant team, there are edition contexts
where it's perfectly valid to have no "live" selection for one reason
or an other, so this should be fixed.

Ideally the field should also properly be discarded such that the
event listener is removed and the callback is never called at all,
however the legacy client has no such hook at the field level (the
controller seems to be the lowest).

closes odoo/odoo#96517

Related: odoo/documentation#2550
Related: odoo/enterprise#29824
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2022-08-04 09:14:11 +02:00
..
2022-07-07 13:30:24 +02:00
2022-07-07 13:30:24 +02:00
2022-07-07 13:30:24 +02:00
2022-07-07 13:30:24 +02:00
2022-08-03 13:44:49 +02:00
2022-07-07 13:30:24 +02:00
2022-07-07 13:30:24 +02:00
2022-08-03 13:44:49 +02:00
2022-07-07 13:30:24 +02:00
2022-07-07 13:30:24 +02:00
2022-07-07 13:30:24 +02:00
2022-07-07 13:30:24 +02:00
2022-07-07 13:30:24 +02:00
2022-08-03 13:44:49 +02:00
2022-08-03 13:44:49 +02:00
2022-08-03 13:44:49 +02:00
2022-07-07 13:30:24 +02:00
2022-08-03 13:44:49 +02:00
2022-07-07 13:30:24 +02:00
2022-07-07 13:30:24 +02:00
2022-07-07 13:30:24 +02:00
2022-07-07 13:30:24 +02:00
2022-07-07 13:30:24 +02:00
2022-07-07 13:30:24 +02:00
2022-07-07 13:30:24 +02:00
2022-08-03 13:44:49 +02:00
2022-08-03 13:44:49 +02:00
2022-08-03 13:44:49 +02:00
2022-07-07 13:30:24 +02:00
2022-08-03 13:44:49 +02:00
2022-08-03 13:44:49 +02:00
2022-07-07 13:30:24 +02:00
2022-07-07 13:30:24 +02:00
2022-07-07 13:30:24 +02:00
2022-07-07 13:30:24 +02:00
2022-07-07 13:30:24 +02:00
2022-07-07 13:30:24 +02:00