Skip to content

Commit ac6be9d

Browse files
committed
MC-3966: Block type errors when no block is selected and grid is empty
- Added type checks for empty values
1 parent c4a90c6 commit ac6be9d

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/block/preview.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/js/form/element/block-chooser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ define([
6464
var requestData = $.extend(true, {}, this.requestData);
6565

6666
// The component hasn't be configured yet. Nothing to do.
67-
if (!this.id() || !this.requestParameter || !this.dataUrlConfigPath) {
67+
if (!this.id().length || !this.requestParameter || !this.dataUrlConfigPath) {
6868
return;
6969
}
7070

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/content-type/block/preview.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export default class Preview extends BasePreview {
8888
this.placeholderText("");
8989
}
9090

91-
if (!data.block_id || data.template.length === 0) {
91+
if (!data.block_id || (data.block_id && data.block_id.length === 0) || data.template.length === 0) {
9292
this.showBlockPreview(false);
9393
this.placeholderText(this.messages.NOT_SELECTED);
9494
return;

0 commit comments

Comments
 (0)