From 86026d72602bae506381f6cce5bd00bc0d5a8822 Mon Sep 17 00:00:00 2001 From: Adnan Saiyed Date: Wed, 11 Oct 2023 15:44:22 +0530 Subject: [PATCH] [FIX] web_editor: Image crop option not working Current behaviour before commit: When pressing crop button, crop widget is not getting opened and 'connection lost' notification is appeared. This happens because in wysiwyg.js file _rpc function does not get the proper arguments from loadImageInfo function. Desired behaviour after commit: Now, _rpc function is removed from wysiwyg.js as it doesn't need anymore and _serviceRpc is passed directly through the props. As result crop option works. task-3546160 closes odoo/odoo#138482 Signed-off-by: Nicolas Bayet (nby) --- addons/web_editor/static/src/js/wysiwyg/wysiwyg.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js index 8dd7b67cdbd..0f83dac952e 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js @@ -132,7 +132,7 @@ export class Wysiwyg extends Component { }), } imageCropProps = useState({ - rpc: this._rpc.bind(this), + rpc: this._serviceRpc.bind(this), showCount: 0, media: undefined, mimetype: undefined, @@ -3505,9 +3505,6 @@ export class Wysiwyg extends Component { xhr: settings.xhr, }); } - _rpc({ route, params }) { - return this._serviceRpc(route, params) - } } Wysiwyg.activeCollaborationChannelNames = new Set(); Wysiwyg.activeWysiwygs = new Set();