Files
odoo_source/addons/web_editor
Benjamin Vray cc6cf9ef13 [FIX] web_editor, *: fix replacing an image with shape by another media
*: test_website, website

Steps to reproduce the bug:
- Drag and drop a text-image snippet onto the page.
- Add a shape to the image of the snippet by selecting the shape from
the options.
- Click on the "replace" button in the options of the image.
- In the media dialog, navigate to the "icons" tab.
- Choose an icon.
- Inspect the HTML code of the icon in the DOM.
- Bug: The 'data-shape' attribute with a value is still present.

After this commit, when replacing media, the transfer of element
attributes specific to "shape" elements only occurs towards an image and
no longer towards other media (e.g. icons).

We also prevent adding shapes to images that don't support it (e.g. SVG
files). Before this commit, when replacing a .jpeg image that had
a shape with a SVG image, the shape was not removed.

This commit also adds tests to prevent these bugs from reappearing.

task-3420533

closes odoo/odoo#129079

X-original-commit: 023b0b3124a7181fdf486df8c830bb16edd10aa6
Signed-off-by: Soukéina Bojabza (sobo) <sobo@odoo.com>
2023-07-20 10:07:25 +02:00
..
…
2023-07-18 11:42:26 +02:00
2023-06-12 22:39:26 +02:00