From 071e1e03c3c455501d25d422ee9d7f3e6fcdb596 Mon Sep 17 00:00:00 2001 From: Tetiana Blindaruk Date: Fri, 2 Apr 2021 21:48:47 +0300 Subject: [PATCH 1/6] [6.x] update changelog --- CHANGELOG-6.x.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG-6.x.md b/CHANGELOG-6.x.md index cc073b4d93f..3e7eb539974 100644 --- a/CHANGELOG-6.x.md +++ b/CHANGELOG-6.x.md @@ -1,6 +1,16 @@ # Release Notes for 6.x -## [Unreleased](https://github.com/laravel/framework/compare/v6.20.20...6.x) +## [Unreleased](https://github.com/laravel/framework/compare/v6.20.21...6.x) + + +## [v6.20.21 (2021-03-30)](https://github.com/laravel/framework/compare/v6.20.20...v6.20.21) + +### Added +- Added support of DynamoDB in CI suite ([#36749](https://github.com/laravel/framework/pull/36749)) +- Support username parameter for predis ([#36762](https://github.com/laravel/framework/pull/36762)) + +### Changed +- Use qualified column names in pivot query ([#36720](https://github.com/laravel/framework/pull/36720)) ## [v6.20.20 (2021-03-23)](https://github.com/laravel/framework/compare/v6.20.19...v6.20.20) From f1e98e6da0f58b2feb7d8f376370e8889721e2cf Mon Sep 17 00:00:00 2001 From: Tetiana Blindaruk Date: Fri, 2 Apr 2021 21:51:10 +0300 Subject: [PATCH 2/6] [6.x] update changelog --- CHANGELOG-6.x.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG-6.x.md b/CHANGELOG-6.x.md index 3e7eb539974..c88ba87c721 100644 --- a/CHANGELOG-6.x.md +++ b/CHANGELOG-6.x.md @@ -1,6 +1,12 @@ # Release Notes for 6.x -## [Unreleased](https://github.com/laravel/framework/compare/v6.20.21...6.x) +## [Unreleased](https://github.com/laravel/framework/compare/v6.20.22...6.x) + + +## [v6.20.22 (2021-03-31)](https://github.com/laravel/framework/compare/v6.20.21...v6.20.22) + +### Fixed +- Fixed setting DynamoDB credentials ([#36822](https://github.com/laravel/framework/pull/36822)) ## [v6.20.21 (2021-03-30)](https://github.com/laravel/framework/compare/v6.20.20...v6.20.21) From 42102589bc7f7b8533ee1b815ef0cc18017d4e45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rihards=20=C5=A0=C4=8Deredins?= Date: Thu, 8 Apr 2021 15:38:18 +0300 Subject: [PATCH 3/6] Add more messages for detecting lost connection (happens during managed PostgreSQL upgrade on DigitalOcean) (#36911) --- src/Illuminate/Database/DetectsLostConnections.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Illuminate/Database/DetectsLostConnections.php b/src/Illuminate/Database/DetectsLostConnections.php index 191eefedc89..93be53b2fdc 100644 --- a/src/Illuminate/Database/DetectsLostConnections.php +++ b/src/Illuminate/Database/DetectsLostConnections.php @@ -52,6 +52,8 @@ protected function causedByLostConnection(Throwable $e) 'Temporary failure in name resolution', 'SSL: Broken pipe', 'SQLSTATE[08S01]: Communication link failure', + 'SQLSTATE[08006] [7] could not connect to server: Connection refused Is the server running on host', + 'SQLSTATE[HY000]: General error: 7 SSL SYSCALL error: No route to host', ]); } } From e1f36fa3819c0d4b155dadcf19926d73045b9784 Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Tue, 13 Apr 2021 15:06:47 +0200 Subject: [PATCH 4/6] [6.x] Fix required_if boolean validation (#36967) * Fix required_if boolean validation * Update ValidatesAttributes.php Co-authored-by: Taylor Otwell --- .../Validation/Concerns/ValidatesAttributes.php | 13 ++++++++++++- tests/Validation/ValidationValidatorTest.php | 11 +++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Validation/Concerns/ValidatesAttributes.php b/src/Illuminate/Validation/Concerns/ValidatesAttributes.php index 13fe1a64810..68b38aa8491 100644 --- a/src/Illuminate/Validation/Concerns/ValidatesAttributes.php +++ b/src/Illuminate/Validation/Concerns/ValidatesAttributes.php @@ -1475,13 +1475,24 @@ protected function prepareValuesAndOther($parameters) $values = array_slice($parameters, 1); - if (is_bool($other)) { + if ($this->shouldConvertToBoolean($parameters[0]) || is_bool($other)) { $values = $this->convertValuesToBoolean($values); } return [$values, $other]; } + /** + * Check if parameter should be converted to boolean. + * + * @param string $parameter + * @return bool + */ + protected function shouldConvertToBoolean($parameter) + { + return in_array('boolean', Arr::get($this->rules, $parameter, [])); + } + /** * Convert the given values to boolean if they are string "true" / "false". * diff --git a/tests/Validation/ValidationValidatorTest.php b/tests/Validation/ValidationValidatorTest.php index 4ac71213c98..2938f18e92b 100755 --- a/tests/Validation/ValidationValidatorTest.php +++ b/tests/Validation/ValidationValidatorTest.php @@ -1090,6 +1090,17 @@ public function testRequiredIf() $v = new Validator($trans, ['first' => 'dayle', 'last' => ''], ['last' => 'RequiredIf:first,taylor,dayle']); $this->assertFalse($v->passes()); $this->assertSame('The last field is required when first is dayle.', $v->messages()->first('last')); + + $trans = $this->getIlluminateArrayTranslator(); + $trans->addLines(['validation.required_if' => 'The :attribute field is required when :other is :value.'], 'en'); + $v = new Validator($trans, ['foo' => 0], [ + 'foo' => 'required|boolean', + 'bar' => 'required_if:foo,true', + 'baz' => 'required_if:foo,false', + ]); + $this->assertTrue($v->fails()); + $this->assertCount(1, $v->messages()); + $this->assertSame('The baz field is required when foo is 0.', $v->messages()->first('baz')); } public function testRequiredUnless() From 63655bf44ad7c3b2483c4a3c112831326f92e68c Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Tue, 13 Apr 2021 15:39:47 +0200 Subject: [PATCH 5/6] Revert "[6.x] Fix required_if boolean validation (#36967)" This reverts commit e1f36fa3819c0d4b155dadcf19926d73045b9784. --- .../Validation/Concerns/ValidatesAttributes.php | 13 +------------ tests/Validation/ValidationValidatorTest.php | 11 ----------- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/src/Illuminate/Validation/Concerns/ValidatesAttributes.php b/src/Illuminate/Validation/Concerns/ValidatesAttributes.php index 68b38aa8491..13fe1a64810 100644 --- a/src/Illuminate/Validation/Concerns/ValidatesAttributes.php +++ b/src/Illuminate/Validation/Concerns/ValidatesAttributes.php @@ -1475,24 +1475,13 @@ protected function prepareValuesAndOther($parameters) $values = array_slice($parameters, 1); - if ($this->shouldConvertToBoolean($parameters[0]) || is_bool($other)) { + if (is_bool($other)) { $values = $this->convertValuesToBoolean($values); } return [$values, $other]; } - /** - * Check if parameter should be converted to boolean. - * - * @param string $parameter - * @return bool - */ - protected function shouldConvertToBoolean($parameter) - { - return in_array('boolean', Arr::get($this->rules, $parameter, [])); - } - /** * Convert the given values to boolean if they are string "true" / "false". * diff --git a/tests/Validation/ValidationValidatorTest.php b/tests/Validation/ValidationValidatorTest.php index 2938f18e92b..4ac71213c98 100755 --- a/tests/Validation/ValidationValidatorTest.php +++ b/tests/Validation/ValidationValidatorTest.php @@ -1090,17 +1090,6 @@ public function testRequiredIf() $v = new Validator($trans, ['first' => 'dayle', 'last' => ''], ['last' => 'RequiredIf:first,taylor,dayle']); $this->assertFalse($v->passes()); $this->assertSame('The last field is required when first is dayle.', $v->messages()->first('last')); - - $trans = $this->getIlluminateArrayTranslator(); - $trans->addLines(['validation.required_if' => 'The :attribute field is required when :other is :value.'], 'en'); - $v = new Validator($trans, ['foo' => 0], [ - 'foo' => 'required|boolean', - 'bar' => 'required_if:foo,true', - 'baz' => 'required_if:foo,false', - ]); - $this->assertTrue($v->fails()); - $this->assertCount(1, $v->messages()); - $this->assertSame('The baz field is required when foo is 0.', $v->messages()->first('baz')); } public function testRequiredUnless() From d94c07d72c14f07e7d2027458e7f0a76f9ceb0d9 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 13 Apr 2021 08:49:28 -0500 Subject: [PATCH 6/6] patch --- src/Illuminate/Foundation/Application.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Foundation/Application.php b/src/Illuminate/Foundation/Application.php index 34bbb83f924..9e37bd61811 100755 --- a/src/Illuminate/Foundation/Application.php +++ b/src/Illuminate/Foundation/Application.php @@ -31,7 +31,7 @@ class Application extends Container implements ApplicationContract, HttpKernelIn * * @var string */ - const VERSION = '6.20.22'; + const VERSION = '6.20.23'; /** * The base path for the Laravel installation.