[FIX] web_editor: do nothing on save if no media was selected in modal
When in the media modal, if one selected no media but clicked the "ADD" button it resulted in an error and a failed RPC instead of simply closing the modal without doing anything. v12 behavior is now restored. closes odoo/odoo#31308
This commit is contained in:
@@ -151,6 +151,9 @@ var MediaPlugin = AbstractPlugin.extend({
|
||||
* @param {Object} data contains the media to insert
|
||||
*/
|
||||
insertMedia: function (previous, data) {
|
||||
if (!data.media) {
|
||||
return;
|
||||
}
|
||||
var newMedia = data.media;
|
||||
this._wrapCommand(function () {
|
||||
this.$editable.focus();
|
||||
|
||||
Reference in New Issue
Block a user