From 2d1eea523ba445aa50b5b79786b289f7befb651b Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Sat, 13 May 2023 14:39:34 +0200 Subject: [PATCH 1/3] ci: Prevent concurrent CI runs (#515) --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dcf7af82..b8e7d20c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,3 +60,6 @@ jobs: env: CI: true - run: bash <(curl -s https://codecov.io/bash) +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true From 0fc3d8f630ba918689f2901e96c631d761561b74 Mon Sep 17 00:00:00 2001 From: Diamond Lewis Date: Sat, 13 May 2023 07:40:27 -0500 Subject: [PATCH 2/3] fix: Prevent `query->equalTo` from overriding other conditions (#510) --- src/Parse/ParseQuery.php | 2 +- tests/Parse/ParseQueryTest.php | 57 +++++++++++++++++++++++++++++++++- 2 files changed, 57 insertions(+), 2 deletions(-) diff --git a/src/Parse/ParseQuery.php b/src/Parse/ParseQuery.php index 2782995e..64a50561 100644 --- a/src/Parse/ParseQuery.php +++ b/src/Parse/ParseQuery.php @@ -140,7 +140,7 @@ public function get($objectId, $useMasterKey = false) */ public function equalTo($key, $value) { - $this->where[$key] = $value; + $this->addCondition($key, '$eq', $value); return $this; } diff --git a/tests/Parse/ParseQueryTest.php b/tests/Parse/ParseQueryTest.php index 30fc5a18..536971b1 100644 --- a/tests/Parse/ParseQueryTest.php +++ b/tests/Parse/ParseQueryTest.php @@ -2663,7 +2663,9 @@ public function testGetAndSetConditions() $this->assertEquals([ 'where' => [ - 'key' => 'value', + 'key' => [ + '$eq' => 'value', + ], 'key2' => [ '$ne' => 'value2', ], @@ -2719,4 +2721,57 @@ public function testUnknownCondition() 'unrecognized' => 1 ]); } + + /** + * @group query-equalTo-conditions + */ + public function testEqualToWithSameKeyDoesNotOverrideOtherConditions() + { + $baz = new ParseObject('TestObject'); + $baz->setArray('fooStack', [ + [ + 'status' => 'baz' + ], + [ + 'status' => 'bar' + ] + ]); + $baz->save(); + + $bar = new ParseObject('TestObject'); + $bar->setArray('fooStack', [ + [ + 'status' => 'bar' + ] + ]); + $bar->save(); + + $qux = new ParseObject('TestObject'); + $qux->setArray('fooStack', [ + [ + 'status' => 'bar', + ], + [ + 'status' => 'qux' + ] + ]); + $qux->save(); + + $query = new ParseQuery('TestObject'); + $query->notEqualTo('fooStack.status', 'baz'); + $query->equalTo('fooStack.status', 'bar'); + + $this->assertEquals(2, $query->count(true)); + + $this->assertSame([ + 'where' => [ + 'fooStack.status' => [ + '$ne' => 'baz', + '$eq' => 'bar', + ] + ], + 'limit' => 0, + 'count' => 1, + ], $query->_getOptions()); + } } From 8b17fa973fbbb0dd00c573879dc4350e9e4346ac Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sat, 13 May 2023 12:41:45 +0000 Subject: [PATCH 3/3] chore(release): 2.3.1 [skip ci] ## [2.3.1](https://github.com/parse-community/parse-php-sdk/compare/2.3.0...2.3.1) (2023-05-13) ### Bug Fixes * Prevent `query->equalTo` from overriding other conditions ([#510](https://github.com/parse-community/parse-php-sdk/issues/510)) ([0fc3d8f](https://github.com/parse-community/parse-php-sdk/commit/0fc3d8f630ba918689f2901e96c631d761561b74)) --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- src/Parse/ParseClient.php | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 705090b6..fab2ad7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [2.3.1](https://github.com/parse-community/parse-php-sdk/compare/2.3.0...2.3.1) (2023-05-13) + + +### Bug Fixes + +* Prevent `query->equalTo` from overriding other conditions ([#510](https://github.com/parse-community/parse-php-sdk/issues/510)) ([0fc3d8f](https://github.com/parse-community/parse-php-sdk/commit/0fc3d8f630ba918689f2901e96c631d761561b74)) + # [2.3.0](https://github.com/parse-community/parse-php-sdk/compare/2.2.0...2.3.0) (2023-05-13) diff --git a/package-lock.json b/package-lock.json index 99ef162b..80acb5bd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "parse-php-sdk", - "version": "2.3.0", + "version": "2.3.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "parse-php-sdk", - "version": "2.3.0", + "version": "2.3.1", "license": "BSD-3-Clause", "devDependencies": { "@semantic-release/changelog": "6.0.3", diff --git a/package.json b/package.json index 1ffc260e..d9de76ce 100644 --- a/package.json +++ b/package.json @@ -32,5 +32,5 @@ "semantic-release": "21.0.1", "winston": "3.2.1" }, - "version": "2.3.0" + "version": "2.3.1" } diff --git a/src/Parse/ParseClient.php b/src/Parse/ParseClient.php index 864c04e5..cc546b2d 100755 --- a/src/Parse/ParseClient.php +++ b/src/Parse/ParseClient.php @@ -115,7 +115,7 @@ final class ParseClient * * @var string */ - const VERSION_STRING = '2.3.0'; + const VERSION_STRING = '2.3.1'; /** * Parse\Client::initialize, must be called before using Parse features.