File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,12 @@ class ChartSelect extends Component {
157157
158158 const openEditChart = ( chartId ) => {
159159 const baseURL = ( window . visualizerLocalize . chartEditUrl ) ? window . visualizerLocalize . chartEditUrl : '' ;
160+ if ( isD3 ) {
161+ if ( window . visualizerLocalize && window . visualizerLocalize . adminPage ) {
162+ window . open ( window . visualizerLocalize . adminPage , '_blank' ) ;
163+ }
164+ return ;
165+ }
160166 let view = new visualizerMediaView . Chart (
161167 {
162168 action : `${ baseURL } ?action=visualizer-edit-chart&library=yes&chart=` + chartId
Original file line number Diff line number Diff line change @@ -341,10 +341,13 @@ public function renderChart( $atts ) {
341341 return '' ;
342342 }
343343
344- // in case revisions exist.
345- $ revisions = $ this ->undoRevisions ( $ chart ->ID , true );
346- if ( true === $ revisions ) {
347- $ chart = get_post ( $ chart ->ID );
344+ // in case revisions exist (skip D3 charts to avoid reverting AI data).
345+ $ chart_library = get_post_meta ( $ chart ->ID , Visualizer_Plugin::CF_CHART_LIBRARY , true );
346+ if ( 'd3 ' !== $ chart_library ) {
347+ $ revisions = $ this ->undoRevisions ( $ chart ->ID , true );
348+ if ( true === $ revisions ) {
349+ $ chart = get_post ( $ chart ->ID );
350+ }
348351 }
349352
350353 $ id = 'visualizer- ' . $ atts ['id ' ];
You can’t perform that action at this time.
0 commit comments