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

WP in Mono-site, Undefined array key "id_column_exists" warning log #284

Open
f-leclere opened this issue Nov 9, 2023 · 1 comment · Fixed by #285
Open

WP in Mono-site, Undefined array key "id_column_exists" warning log #284

f-leclere opened this issue Nov 9, 2023 · 1 comment · Fixed by #285

Comments

@f-leclere
Copy link

Hi,
id_column_exists variable is not defined when wordpress is in mono-site mode.

Warning: Undefined array key "id_column_exists" in //wp-native-php-sessions/pantheon-sessions.php on line 562

My proposal is to modify pantheon-sessions.php like following

	public function add_index( $start_position ) {
		global $wpdb;

		$output = [
			'no_session_table' => 0,
			'id_column_exists' => 0,
		];
		if ( ! is_multisite() ) {
			$this->safe_output( __( 'Single site detected. Beginning processing... \n', 'wp-native-php-sessions' ), 'log' );

			$this->add_single_index( $wpdb->prefix, $output );

			$this->safe_output( __( 'Operation complete, please verify that your site is working as expected. When ready, run wp pantheon session primary-key-finalize to clean up old data, or run wp pantheon session primary-key-revert if there were issues.', 'wp-native-php-sessions' ), 'log' );

			return;
		}

		$this->safe_output( __( 'Multisite installation detected. Processing Sites individually...', 'wp-native-php-sessions' ), 'log' );

		$site_list = $this->get_all_sites( $start_position );
		$site_count = count( $site_list );

@jazzsequence
Copy link
Contributor

Thanks for reporting this. Tracking internally as BUGS-7105.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants