Skip to content
Permalink
Browse files

[FIX] web_editor: fix makeLayoutInfo

Issue

        - Install Website
        - Edit your website

        Do this 8 times:
        - Add the block "Image - Text" under each product
        - Make image on left smaller and text longer
        - Edit the size/color of the title and the description

        There is some case where it will crash

Cause

        We override the method who gets the editor:
        `x = $('[data-note-id="' + list.last($target.attr('id')) + '"]');`
        When there is more than 9 editors in the page
        (because we edited 10 different HTML fields), we reach the
        editor with ID 10 but the code erroneously will not find the
        editor with ID 0

Solution

        Use this instead:
        ```
        x = $('[data-note-id="' + list.last($target.attr('id').split('-')) + '"]');
        ```

OPW-2218467

closes #48001

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
  • Loading branch information
jvm-odoo committed Mar 25, 2020
1 parent 7b1fed7 commit 354c30cfd89bb93549af204942c3aace41205e4b
Showing with 1 addition and 1 deletion.
  1. +1 −1 addons/web_editor/static/lib/summernote/src/js/core/dom.js
@@ -122,7 +122,7 @@ define([
} else {
// ODOO: editor on [data-note-id] attribute
// $editor = $('#note-editor-' + list.last($target.attr('id').split('-')));
$editor = $('[data-note-id="' + list.last($target.attr('id')) + '"]');
$editor = $('[data-note-id="' + list.last($target.attr('id').split('-')) + '"]');
}

return buildLayoutInfo($editor);

0 comments on commit 354c30c

Please sign in to comment.
You can’t perform that action at this time.