Skip to content

Commit b550a93

Browse files
committed
version 1.1.10 released
1 parent 58e9edf commit b550a93

File tree

6 files changed

+310
-384
lines changed

6 files changed

+310
-384
lines changed

README.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: codeboxr, manchumahara
33
Tags: changelog,history,release,version,product log
44
Requires at least: 5.3
55
Tested up to: 6.7.1
6-
Stable tag: 1.1.9
6+
Stable tag: 1.1.10
77
Requires PHP: 7.4
88
License: GPLv2 or later
99
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -73,6 +73,9 @@ This helps to write changes log for any digital products, projects releases. Any
7373

7474

7575
== Changelog ==
76+
= 1.1.10 =
77+
* [fixed] Changelog added at top from edit screen save error fixed! [Sorry for the inconvenience]
78+
7679
= 1.1.9 =
7780
* [new] Added new shortcode param 'count' , 0 means all, any value more than 0 show as specific number of changelogs
7881
* [new] Dashboard changelog edit screenshot has two buttons for adding change log 1. Add changelog at bottom, 2. Add changelog at top

cbxchangelog.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* Plugin Name: CBX Changelog
1717
* Plugin URI: http://codeboxr.com/product/cbx-changelog-for-wordpress/
1818
* Description: Easy change log manager for WordPress, use for any product post type or releases notes
19-
* Version: 1.1.9
19+
* Version: 1.1.10
2020
* Author: Codeboxr
2121
* Author URI: http://codeboxr.com
2222
* License: GPL-2.0+
@@ -32,7 +32,7 @@
3232

3333

3434
defined( 'CBXCHANGELOG_PLUGIN_NAME' ) or define( 'CBXCHANGELOG_PLUGIN_NAME', 'cbxchangelog' );
35-
defined( 'CBXCHANGELOG_PLUGIN_VERSION' ) or define( 'CBXCHANGELOG_PLUGIN_VERSION', '1.1.9' );
35+
defined( 'CBXCHANGELOG_PLUGIN_VERSION' ) or define( 'CBXCHANGELOG_PLUGIN_VERSION', '1.1.10' );
3636
defined( 'CBXCHANGELOG_ROOT_PATH' ) or define( 'CBXCHANGELOG_ROOT_PATH', plugin_dir_path( __FILE__ ) );
3737
defined( 'CBXCHANGELOG_ROOT_URL' ) or define( 'CBXCHANGELOG_ROOT_URL', plugin_dir_url( __FILE__ ) );
3838
defined( 'CBXCHANGELOG_BASE_NAME' ) or define( 'CBXCHANGELOG_BASE_NAME', plugin_basename( __FILE__ ) );

includes/CBXChangelogAdmin.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,18 @@ public function metabox_save( $post_id, $post, $update ) {
320320
$submitted_values = isset( $_POST['cbxchangelog_logs'] ) ? wp_unslash( $_POST['cbxchangelog_logs'] ) : []; //phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
321321

322322
$meta_data = CBXChangelogHelper::get_changelog_data( $post_id );
323+
$meta_data->reindexUsedKeys();//let's confirm the usedKeys are not messed or rearranged
323324
$used_keys = $meta_data->getUsedKeys();
325+
$nextIndex = max($used_keys) + 1;
326+
327+
328+
324329
//let's reset as we need to honor the index order to display
325330
$meta_data->resetRows();
331+
$meta_data->settNextIndex($nextIndex);
332+
333+
334+
326335

327336
foreach ( $submitted_values as $value ) {
328337
$valid_change_log = [];
@@ -384,13 +393,10 @@ public function metabox_save( $post_id, $post, $update ) {
384393
}*/
385394

386395

387-
if ( $id > 0 ) {
388-
$valid_change_log['id'] = $id;
389-
}
390396

397+
$valid_change_log['id'] = $id == 0 ? $meta_data->getNextIndex() : $id;
391398
$meta_data->insert( $valid_change_log );
392399

393-
394400
unset( $valid_change_log );
395401
//$valid_change_logs[] = $valid_change_log;
396402
}//end for each

0 commit comments

Comments
 (0)