Skip to content

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

@f-leclere

Description

@f-leclere

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 );

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions