Skip to content

Commit 6733217

Browse files
Merge pull request #276 from contactashish13/issue-120
Style gets to default when we edit > Cancel a chart
2 parents e07e6b3 + 9651cfd commit 6733217

File tree

6 files changed

+58
-5
lines changed

6 files changed

+58
-5
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11

2+
### v3.0.9 - 2018-07-12
3+
**Changes:**
4+
* New chart title option for the back-end of the charts that don't allow a title on the front-end
5+
* Store the png images of the charts in a global array that can be used in JS
6+
* Added options for charts animations
7+
8+
### v3.0.8 - 2018-06-27
9+
**Changes:**
10+
* Added revision support for the chart post type
11+
* Added both % and Value to the Pie Slice
12+
* Use the blog locale for Visualizer's options
13+
* Fixed issue with data being fetched from the remote source every single time the chart was shown
14+
* Fixed issue with scheduled charts not being updated if one of the scheduled charts is deleted
15+
216
### v3.0.7 - 2018-03-26
317
**Changes:**
418
* Adds insert button in chart library.

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/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

readme.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,22 @@ Pay attention that to turn your shortcodes into graphs, your theme has to have `
144144
5. Charts library
145145

146146
## Changelog ##
147+
### 3.0.9 - 2018-07-12 ###
148+
149+
* New chart title option for the back-end of the charts that don't allow a title on the front-end
150+
* Store the png images of the charts in a global array that can be used in JS
151+
* Added options for charts animations
152+
153+
154+
### 3.0.8 - 2018-06-27 ###
155+
156+
* Added revision support for the chart post type
157+
* Added both % and Value to the Pie Slice
158+
* Use the blog locale for Visualizer's options
159+
* Fixed issue with data being fetched from the remote source every single time the chart was shown
160+
* Fixed issue with scheduled charts not being updated if one of the scheduled charts is deleted
161+
162+
147163
### 3.0.7 - 2018-03-26 ###
148164

149165
* Adds insert button in chart library.

readme.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,22 @@ Pay attention that to turn your shortcodes into graphs, your theme has to have `
144144
5. Charts library
145145

146146
== Changelog ==
147+
= 3.0.9 - 2018-07-12 =
148+
149+
* New chart title option for the back-end of the charts that don't allow a title on the front-end
150+
* Store the png images of the charts in a global array that can be used in JS
151+
* Added options for charts animations
152+
153+
154+
= 3.0.8 - 2018-06-27 =
155+
156+
* Added revision support for the chart post type
157+
* Added both % and Value to the Pie Slice
158+
* Use the blog locale for Visualizer's options
159+
* Fixed issue with data being fetched from the remote source every single time the chart was shown
160+
* Fixed issue with scheduled charts not being updated if one of the scheduled charts is deleted
161+
162+
147163
= 3.0.7 - 2018-03-26 =
148164

149165
* Adds insert button in chart library.

themeisle-hash.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"index.php":"87f5029281c969a4b6d0869f7594a04a"}
1+
{"index.php":"6aa5f5dcf6ae81c21b03e5123e007d6e"}

0 commit comments

Comments
 (0)