From c792d18c4e312fa60184cd46bc71ea48bc8ce87c Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Tue, 23 Apr 2024 15:52:32 -0600 Subject: [PATCH 1/8] close parenthesis --- includes/class-solrpower-wp-query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-solrpower-wp-query.php b/includes/class-solrpower-wp-query.php index f3b2d8e3..9b9b72e1 100644 --- a/includes/class-solrpower-wp-query.php +++ b/includes/class-solrpower-wp-query.php @@ -740,7 +740,7 @@ private function parse_tax_query( $tax_query ) { $multi_query = array(); $multi_query[] = '(' . $field . ':(' . implode( 'OR', $terms ) . '))'; if ( $tax_value['include_children'] && is_taxonomy_hierarchical( $tax_value['taxonomy'] ) ) { - $multi_query[] = '(parent_' . $field . ':' . implode( 'OR', $terms ) . ')'; + $multi_query[] = '(parent_' . $field . ':' . implode( 'OR', $terms ) . '))'; } $query[] = '(' . implode( 'OR', $multi_query ) . ')'; break; From 1533195e7aaaf3f2aa7a87a76bbd9e896c5e08e9 Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Tue, 23 Apr 2024 16:10:04 -0600 Subject: [PATCH 2/8] add debugging code --- tests/phpunit/wp_query/test-tax-query.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/wp_query/test-tax-query.php b/tests/phpunit/wp_query/test-tax-query.php index 87417ce6..4a99deb3 100644 --- a/tests/phpunit/wp_query/test-tax-query.php +++ b/tests/phpunit/wp_query/test-tax-query.php @@ -29,7 +29,7 @@ function test_wp_query_by_tax() { ), ); $query = new WP_Query( $args ); - + var_dump( $query->post ); $this->assertEquals( $p_id, $query->post->ID ); } @@ -1319,4 +1319,4 @@ public function test_term_taxonomy_id_field_no_taxonomy() { ), $results2, 'Relation: AND; Operator: IN' ); } -} \ No newline at end of file +} From 3ff32682c13c53a1d1c37bbe92db04ade293657d Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Tue, 23 Apr 2024 16:29:37 -0600 Subject: [PATCH 3/8] add opening parenthesis Co-authored-by: Phil Tyler --- includes/class-solrpower-wp-query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-solrpower-wp-query.php b/includes/class-solrpower-wp-query.php index 9b9b72e1..f9884793 100644 --- a/includes/class-solrpower-wp-query.php +++ b/includes/class-solrpower-wp-query.php @@ -740,7 +740,7 @@ private function parse_tax_query( $tax_query ) { $multi_query = array(); $multi_query[] = '(' . $field . ':(' . implode( 'OR', $terms ) . '))'; if ( $tax_value['include_children'] && is_taxonomy_hierarchical( $tax_value['taxonomy'] ) ) { - $multi_query[] = '(parent_' . $field . ':' . implode( 'OR', $terms ) . '))'; + $multi_query[] = '(parent_' . $field . '(:' . implode( 'OR', $terms ) . '))'; } $query[] = '(' . implode( 'OR', $multi_query ) . ')'; break; From 44015001f9c09ad13c7b13a6c818a0dfeb6469b8 Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Tue, 23 Apr 2024 16:34:23 -0600 Subject: [PATCH 4/8] make the emoji sad --- includes/class-solrpower-wp-query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-solrpower-wp-query.php b/includes/class-solrpower-wp-query.php index f9884793..3ab9cc23 100644 --- a/includes/class-solrpower-wp-query.php +++ b/includes/class-solrpower-wp-query.php @@ -740,7 +740,7 @@ private function parse_tax_query( $tax_query ) { $multi_query = array(); $multi_query[] = '(' . $field . ':(' . implode( 'OR', $terms ) . '))'; if ( $tax_value['include_children'] && is_taxonomy_hierarchical( $tax_value['taxonomy'] ) ) { - $multi_query[] = '(parent_' . $field . '(:' . implode( 'OR', $terms ) . '))'; + $multi_query[] = '(parent_' . $field . ':(' . implode( 'OR', $terms ) . '))'; } $query[] = '(' . implode( 'OR', $multi_query ) . ')'; break; From 37b493a1624a019679b2db4201e94354ca432565 Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Tue, 23 Apr 2024 16:43:36 -0600 Subject: [PATCH 5/8] remove debug code --- tests/phpunit/wp_query/test-tax-query.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/phpunit/wp_query/test-tax-query.php b/tests/phpunit/wp_query/test-tax-query.php index 4a99deb3..dd0589e0 100644 --- a/tests/phpunit/wp_query/test-tax-query.php +++ b/tests/phpunit/wp_query/test-tax-query.php @@ -29,7 +29,6 @@ function test_wp_query_by_tax() { ), ); $query = new WP_Query( $args ); - var_dump( $query->post ); $this->assertEquals( $p_id, $query->post->ID ); } From d0eda090d0626f99d55870d4ed4e8f1caccc2793 Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Tue, 23 Apr 2024 17:00:42 -0600 Subject: [PATCH 6/8] update changelog --- CHANGELOG.md | 3 +++ readme.txt | 3 +++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c372316..01a2b5d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ## Changelog ## +### 2.5.3 (April 24, 2024) ### +* Fixes a very old bug that would cause tax queries to be built incorrectly. [[#622](https://github.com/pantheon-systems/solr-power/pull/622)] (props [@offshorealert](https://wordpress.org/support/users/offshorealert/)) + ### 2.5.2 (September 12, 2023) ### * Fix incompatibility with Object Cache Pro when running "wp solr index" [[#611](https://github.com/pantheon-systems/solr-power/pull/611)] diff --git a/readme.txt b/readme.txt index 090255df..851d2949 100644 --- a/readme.txt +++ b/readme.txt @@ -235,6 +235,9 @@ Please report security bugs found in the source code of the Solr Power plugin th == Changelog == += 2.5.3 (April 24, 2024) = +* Fixes a very old bug that would cause tax queries to be built incorrectly. [[#622](https://github.com/pantheon-systems/solr-power/pull/622)] (props [@offshorealert](https://wordpress.org/support/users/offshorealert/)) + = 2.5.2 (September 12, 2023) = * Fix incompatibility with Object Cache Pro when running "wp solr index" [[#611](https://github.com/pantheon-systems/solr-power/pull/611)] From 072c8048cf8a74111dca1f65d014da1bc14e6bd3 Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Tue, 23 Apr 2024 17:01:01 -0600 Subject: [PATCH 7/8] bump version --- README.md | 4 ++-- package.json | 4 ++-- readme.txt | 4 ++-- solr-power.php | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 05640e61..0120cadb 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ **Tags:** search **Requires at least:** 4.6 **Requires PHP:** 7.1 -**Tested up to:** 6.4.1 -**Stable tag:** 2.5.2 +**Tested up to:** 6.5.2 +**Stable tag:** 2.5.3 **License:** GPLv2 or later **License URI:** http://www.gnu.org/licenses/gpl-2.0.html diff --git a/package.json b/package.json index 1411323a..ab88974b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "solr-power", - "version": "2.5.2", + "version": "2.5.3", "repository": { "type": "git", "url": "https://github.com/pantheon-systems/solr-power.git" @@ -23,4 +23,4 @@ "grunt-wp-readme-to-markdown": "~2.1.0", "node-sass": "^9.0.0" } -} \ No newline at end of file +} diff --git a/readme.txt b/readme.txt index 851d2949..1d38bb48 100644 --- a/readme.txt +++ b/readme.txt @@ -3,8 +3,8 @@ Contributors: getpantheon, Outlandish Josh, 10up, collinsinternet, andrew.taylor Tags: search Requires at least: 4.6 Requires PHP: 7.1 -Tested up to: 6.4.1 -Stable tag: 2.5.2 +Tested up to: 6.5.2 +Stable tag: 2.5.3 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html diff --git a/solr-power.php b/solr-power.php index f4f3b76d..9512f0ae 100644 --- a/solr-power.php +++ b/solr-power.php @@ -2,7 +2,7 @@ /** * Plugin Name: Solr Power * Description: Allows WordPress sites to index and search content with ApacheSolr. - * Version: 2.5.2 + * Version: 2.5.3 * Author: Pantheon * Author URI: http://pantheon.io * Text Domain: solr-for-wordpress-on-pantheon @@ -10,7 +10,7 @@ * @package Solr_Power **/ -define( 'SOLR_POWER_VERSION', '2.5.2' ); +define( 'SOLR_POWER_VERSION', '2.5.3' ); /** * Copyright (c) 2011-2022 Pantheon, Matt Weber, Solr Power contributors From a4accac556e45912b5f04d854af72d36ac24d5e9 Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Tue, 23 Apr 2024 17:08:51 -0600 Subject: [PATCH 8/8] if multidev:delete fails, don't fail the test --- bin/behat-cleanup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/behat-cleanup.sh b/bin/behat-cleanup.sh index 8f7e32ee..6d5077d4 100755 --- a/bin/behat-cleanup.sh +++ b/bin/behat-cleanup.sh @@ -20,4 +20,4 @@ set -ex ### # Delete the environment used for this test run. ### -terminus multidev:delete $SITE_ENV --delete-branch --yes +terminus multidev:delete $SITE_ENV --delete-branch --yes || true