Skip to content

Commit 6a0fd42

Browse files
Merge pull request #279 from Codeinwp/development
Fixed problem with chart reverting to the default values Fixed problem with Boolean column type Fixed problem with the Geo chart type not saving colors options
2 parents 2c6f298 + c423592 commit 6a0fd42

File tree

7 files changed

+16
-9
lines changed

7 files changed

+16
-9
lines changed

classes/Visualizer/Module/Chart.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,16 @@ private function _handleDataAndSettingsPage() {
307307
if ( $_SERVER['REQUEST_METHOD'] == 'POST' && isset( $_GET['nonce'] ) && wp_verify_nonce( $_GET['nonce'] ) ) {
308308
if ( $this->_chart->post_status == 'auto-draft' ) {
309309
$this->_chart->post_status = 'publish';
310+
311+
// ensure that a revision is not created. If a revision is created it will have the proper data and the parent of the revision will have default data.
312+
// we do not want any difference in data so disable revisions temporarily.
313+
add_filter( 'wp_revisions_to_keep', '__return_false' );
310314
wp_update_post( $this->_chart->to_array() );
311315
}
312-
update_post_meta( $this->_chart->ID, Visualizer_Plugin::CF_SETTINGS, $_POST );
316+
// save meta data only when it is NOT being canceled.
317+
if ( ! ( isset( $_POST['cancel'] ) && 1 === intval( $_POST['cancel'] ) ) ) {
318+
update_post_meta( $this->_chart->ID, Visualizer_Plugin::CF_SETTINGS, $_POST );
319+
}
313320
$render = new Visualizer_Render_Page_Send();
314321
$render->text = sprintf( '[visualizer id="%d"]', $this->_chart->ID );
315322
wp_iframe( array( $render, 'render' ) );

classes/Visualizer/Plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
class Visualizer_Plugin {
2929

3030
const NAME = 'visualizer';
31-
const VERSION = '3.0.9';
31+
const VERSION = '3.0.10';
3232

3333
// custom post types
3434
const CPT_VISUALIZER = 'visualizer';

classes/Visualizer/Render/Sidebar/Type/Geo.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,21 +224,21 @@ protected function _renderColorAxisSettings() {
224224
self::_renderColorPickerItem(
225225
esc_html__( 'Minimum Value', 'visualizer' ),
226226
'colorAxis[colors][]',
227-
! empty( $this->colorAxis['color'][0] ) ? $this->colorAxis['color'][0] : null,
227+
! empty( $this->colorAxis['colors'][0] ) ? $this->colorAxis['colors'][0] : null,
228228
'#efe6dc'
229229
);
230230

231231
self::_renderColorPickerItem(
232232
esc_html__( 'Intermediate Value', 'visualizer' ),
233233
'colorAxis[colors][]',
234-
! empty( $this->colorAxis['color'][1] ) ? $this->colorAxis['color'][1] : null,
234+
! empty( $this->colorAxis['colors'][1] ) ? $this->colorAxis['colors'][1] : null,
235235
'#82bf7c'
236236
);
237237

238238
self::_renderColorPickerItem(
239239
esc_html__( 'Maximum Value', 'visualizer' ),
240240
'colorAxis[colors][]',
241-
! empty( $this->colorAxis['color'][2] ) ? $this->colorAxis['color'][2] : null,
241+
! empty( $this->colorAxis['colors'][2] ) ? $this->colorAxis['colors'][2] : null,
242242
'#109618'
243243
);
244244

classes/Visualizer/Source.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ protected function _normalizeData( $data ) {
208208
$data[ $i ] = ( is_numeric( $data[ $i ] ) ) ? floatval( $data[ $i ] ) : ( is_numeric( str_replace( ',', '', $data[ $i ] ) ) ? floatval( str_replace( ',', '', $data[ $i ] ) ) : null );
209209
break;
210210
case 'boolean':
211-
$data[ $i ] = ! empty( $data[ $i ] ) ? filter_validate( $data[ $i ], FILTER_VALIDATE_BOOLEAN ) : null;
211+
$data[ $i ] = ! empty( $data[ $i ] ) ? filter_var( $data[ $i ], FILTER_VALIDATE_BOOLEAN ) : null;
212212
break;
213213
case 'timeofday':
214214
$date = new DateTime( '1984-03-16T' . $data[ $i ] );

css/media.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Version: 3.0.9
2+
Version: 3.0.10
33
*/
44
#visualizer-library-view {
55
padding: 30px 10px 10px 30px;

index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Plugin Name: Visualizer: Charts and Graphs Lite
55
Plugin URI: https://themeisle.com/plugins/visualizer-charts-and-graphs-lite/
66
Description: A simple, easy to use and quite powerful tool to create, manage and embed interactive charts into your WordPress posts and pages. The plugin uses Google Visualization API to render charts, which supports cross-browser compatibility (adopting VML for older IE versions) and cross-platform portability to iOS and new Android releases.
7-
Version: 3.0.9
7+
Version: 3.0.10
88
Author: Themeisle
99
Author URI: http://themeisle.com
1010
License: GPL v2.0 or later

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "visualizer",
3-
"version": "3.0.9",
3+
"version": "3.0.10",
44
"description": "Visualizer Lite",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)