Skip to content

Commit 1db9752

Browse files
committed
Validating the VideoUrl on getting video information
1 parent 99f206f commit 1db9752

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

app/code/Magento/ProductVideo/view/adminhtml/web/js/new-video-dialog.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,14 @@ define([
282282
* @private
283283
*/
284284
_onGetVideoInformationClick: function () {
285-
this._onlyVideoPlayer = false;
286-
this._isEditPage = false;
287-
this._videoUrlWidget.trigger('update_video_information');
285+
var videoForm = this.element.find(this._videoFormSelector);
286+
videoForm.validation();
287+
288+
if (this.element.find(this._videoUrlSelector).valid()) {
289+
this._onlyVideoPlayer = false;
290+
this._isEditPage = false;
291+
this._videoUrlWidget.trigger('update_video_information');
292+
}
288293
},
289294

290295
/**
@@ -299,6 +304,13 @@ define([
299304
* @private
300305
*/
301306
_onGetVideoInformationStartRequest: function () {
307+
try {
308+
var videoForm = this.element.find(this._videoFormSelector);
309+
videoForm.validation('clearError');
310+
} catch (e) {
311+
// Do nothing
312+
}
313+
302314
this._videoRequestComplete = false;
303315
},
304316

0 commit comments

Comments
 (0)