Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.4.3 #286

Merged
merged 4 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[BUGS-7105] check if the $output index is set before manipulating it (
#285)

* check if the $output index is set before manipulating it

* update changelog
  • Loading branch information
jazzsequence authored Nov 13, 2023
commit f3b04da89c7f8c301fe86d9115bd20f5d554f2ff
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ Adds a WP-CLI command to add an index to the sessions table if one does not exis
## Changelog ##

### 1.4.3-dev ###
* Fixed a PHP warning when running the `pantheon session add-index` command on a single site installation. [[#285](https://github.com/pantheon-systems/wp-native-php-sessions/pull/285)]

### 1.4.2 (November 8, 2023) ###
* Fixed an issue with the `pantheon session add-index` PHP warning. [[#276](https://github.com/pantheon-systems/wp-native-php-sessions/pull/276/files)]
Expand Down
8 changes: 4 additions & 4 deletions pantheon-sessions.php
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ public function add_single_index( $prefix, $output = [], $multisite = false ) {
$query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $table ) );
if ( ! $wpdb->get_var( $query ) == $table ) {
$this->safe_output( __( 'This site does not have a pantheon_sessions table, and is being skipped.', 'wp-native-php-sessions' ), 'log' );
$output['no_session_table'] = $output['no_session_table'] + 1;
$output['no_session_table'] = isset( $output['no_session_table'] ) ? $output['no_session_table'] + 1 : 1;

return $output;
}
Expand All @@ -559,7 +559,7 @@ public function add_single_index( $prefix, $output = [], $multisite = false ) {
$type = 'log';
}

$output['id_column_exists'] = $output['id_column_exists'] + 1;
$output['id_column_exists'] = isset( $output['id_column_exists'] ) ? $output['id_column_exists'] + 1 : 1;
$this->safe_output( __( 'ID column already exists and does not need to be added to the table.', 'wp-native-php-sessions' ), $type );

return $output;
Expand Down Expand Up @@ -643,7 +643,7 @@ public function primary_key_finalize_single( $prefix = null, $output = [], $mult
if ( ! $multisite ) {
$type = 'error';
} else {
$output['no_old_table'] = $output['no_old_table'] + 1;
$output['no_old_table'] = isset( $output['no_old_table'] ) ? $output['no_old_table'] + 1 : 1;
$type = 'log';
}

Expand Down Expand Up @@ -688,7 +688,7 @@ public function primary_key_revert_single( $prefix = null, $output = [], $multis

if ( ! $wpdb->get_var( $query ) == $old_clone_table ) {
$this->safe_output( __( 'There is no old table to roll back to.', 'wp-native-php-sessions' ), $type );
$output['no_rollback_table'] = $output['no_rollback_table'] + 1;
$output['no_rollback_table'] = isset( $output['no_rollback_table'] ) ? $output['no_rollback_table'] + 1 : 1;

return $output;
}
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ Adds a WP-CLI command to add an index to the sessions table if one does not exis
== Changelog ==

= 1.4.3-dev =
* Fixed a PHP warning when running the `pantheon session add-index` command on a single site installation. [[#285](https://github.com/pantheon-systems/wp-native-php-sessions/pull/285)]

= 1.4.2 (November 8, 2023) =
* Fixed an issue with the `pantheon session add-index` PHP warning. [[#276](https://github.com/pantheon-systems/wp-native-php-sessions/pull/276/files)]
Expand Down