[FIX] web, *: website stuck different scenario
* : website, web_editor, html_editor
Commit [1]:
Steps to reproduce: replacing image stuck issue when deleted
- Go to Website > Edit.
- Add any picture snippet (e.g., Text-Image).
- Click the 'Replace' button and upload an image.
- Open the media dialog again and delete the uploaded image.
- Click the 'Discard' button.
- Try to save the changes.
Issue:
- The website gets stuck in the same position and does not allow saving.
- In the Python terminal, a missing error warning appears because the image is deleted from both
ir.ui.viewandir.attachment.
Expected behaviour:
- Saving should be allowed with a default image, that is similar to other images.
This commit catch the warning response and replaces the deleted image, allowing the website to save changes without getting stuck.
Commit [2]: resolve traceback when leaving edit mode via browser
Steps to reproduce:
- Go to Website > Edit.
- Open the snippet modal and select any snippet.
- Press the 'Back' button in your browser.
- A dialog will appear asking to discard changes; click 'OK'.
- A traceback error occurs, and an empty space appears in the editor.
Issue:
- Previously, a commit addressed a similar scenario, but that time the browser had an event listener bind on hashchange.
- Now, that
hashchangeevent of browser has been replaced withpopstate, which triggers before the 'window' event listener. - As a result, the editor is left in an unstable state, causing a traceback error.
Solution:
- This commit ensures the 'window' event executes before the browser event.
- It verifies if the editor is open and forces a
skipLoad, preventing theroute_changecall in the browser.
task-4570164
Forward-Port-Of: odoo/odoo#199193
@paru-odoo @bso-odoo cherrypicking of pull request odoo/odoo#199193 failed.
- f051c142e426ec2edc16b4d119d72b755aa81225
- 89d541d8c25f46da5fa145db3cfcefdef2eb69c6 <- on this commit
stdout:
Auto-merging addons/web/static/src/core/browser/router.js
Auto-merging addons/website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js
Auto-merging addons/website/static/tests/tours/media_dialog.js
Auto-merging addons/website/tests/test_ui.py
CONFLICT (content): Merge conflict in addons/website/tests/test_ui.py
Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?).
In the former case, you may want to edit this PR message as well.
:warning: after resolving this conflict, you will need to merge it via @robodoo.
More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port
@paru-odoo @bso-odoo this forward port of odoo/odoo#199193 is awaiting action (not merged or closed).
@paru-odoo @bso-odoo this forward port of odoo/odoo#199193 is awaiting action (not merged or closed).
@paru-odoo @bso-odoo this forward port of odoo/odoo#199193 is awaiting action (not merged or closed).
@paru-odoo @bso-odoo this forward port of odoo/odoo#199193 is awaiting action (not merged or closed).
