Skip to content

Commit 79494f5

Browse files
Gutenberg: Error appears while inserting table chart that has data imported from JSON
#611 (comment)
1 parent 9203d48 commit 79494f5

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

classes/Visualizer/Gutenberg/build/block.css

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

classes/Visualizer/Gutenberg/build/block.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

classes/Visualizer/Gutenberg/src/Components/DataTable.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,13 @@ class DataTables extends Component {
7373
const row = {};
7474

7575
columns.forEach( ( j, n ) => {
76-
row[j.data] = i[n];
76+
var datum = i[n];
77+
78+
// datum could be undefined for dynamic data (e.g. through json).
79+
if ( 'undefined' === typeof datum ) {
80+
datum = i[j.data];
81+
}
82+
row[j.data] = datum;
7783
});
7884

7985
return row;

0 commit comments

Comments
 (0)