From 8a213315acb38c17a6f20d5d667b08d756a18341 Mon Sep 17 00:00:00 2001 From: August Miller Date: Fri, 28 Jul 2023 04:13:01 -0700 Subject: [PATCH 1/3] End fenced code block (#19919) --- framework/db/ActiveRecordInterface.php | 1 + 1 file changed, 1 insertion(+) diff --git a/framework/db/ActiveRecordInterface.php b/framework/db/ActiveRecordInterface.php index d845e9d32c..441001a99f 100644 --- a/framework/db/ActiveRecordInterface.php +++ b/framework/db/ActiveRecordInterface.php @@ -144,6 +144,7 @@ interface ActiveRecordInterface extends StaticInstanceInterface * // Use where() to ignore the default condition * // SELECT FROM customer WHERE age>30 * $customers = Customer::find()->where('age>30')->all(); + * ``` * * @return ActiveQueryInterface the newly created [[ActiveQueryInterface]] instance. */ From 504a66dae50c43d7bcfd8cd506b0b4ec2f096b2a Mon Sep 17 00:00:00 2001 From: Clemens Date: Sun, 30 Jul 2023 11:51:25 +0200 Subject: [PATCH 2/3] Update documentation for setCookieParams (#19921) The link for more information about "sameSite" lead to a 404 Not Found. --- framework/web/Session.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/web/Session.php b/framework/web/Session.php index a470e7bfea..40768924cf 100644 --- a/framework/web/Session.php +++ b/framework/web/Session.php @@ -405,7 +405,7 @@ class Session extends Component implements \IteratorAggregate, \ArrayAccess, \Co * 'sameSite' => PHP_VERSION_ID >= 70300 ? yii\web\Cookie::SAME_SITE_LAX : null, * ] * ``` - * See https://www.owasp.org/index.php/SameSite for more information about `sameSite`. + * See https://owasp.org/www-community/SameSite for more information about `sameSite`. * * @throws InvalidArgumentException if the parameters are incomplete. * @see https://www.php.net/manual/en/function.session-set-cookie-params.php From 84c15dc5d1c9114dc0f57d208a557aa63087c576 Mon Sep 17 00:00:00 2001 From: rhertogh Date: Wed, 9 Aug 2023 14:05:46 +0200 Subject: [PATCH 3/3] Fix associative array cell content in Table widget (#19908) * Fixed rendering of assosative arrays in `\yii\console\widgets\Table` * Updated readme for #19908 (fix associative array cell content rendering in Table widget) --------- Co-authored-by: Alexander Makarov --- framework/CHANGELOG.md | 1 + framework/console/widgets/Table.php | 6 +++++- tests/framework/console/widgets/TableTest.php | 5 +++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index dc620a0748..9833be22ac 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -13,6 +13,7 @@ Yii Framework 2 Change Log - Enh #19853: Added support for default value for `\yii\helpers\Console::select()` (rhertogh) - Bug #19868: Added whitespace sanitation for tests, due to updates in ICU 72 (schmunk42) - Enh #19884: Added support Enums in Query Builder (sk1t0n) +- Bug #19908: Fix associative array cell content rendering in Table widget (rhertogh) - Bug #19906: Fixed multiline strings in the `\yii\console\widgets\Table` widget (rhertogh) diff --git a/framework/console/widgets/Table.php b/framework/console/widgets/Table.php index 658cf5fd55..c0ece4d4d8 100644 --- a/framework/console/widgets/Table.php +++ b/framework/console/widgets/Table.php @@ -136,7 +136,11 @@ class Table extends Widget { $this->rows = array_map(function($row) { return array_map(function($value) { - return empty($value) && !is_numeric($value) ? ' ' : $value; + return empty($value) && !is_numeric($value) + ? ' ' + : (is_array($value) + ? array_values($value) + : $value); }, array_values($row)); }, $rows); return $this; diff --git a/tests/framework/console/widgets/TableTest.php b/tests/framework/console/widgets/TableTest.php index b5bf6f2c6d..796c95ad1d 100644 --- a/tests/framework/console/widgets/TableTest.php +++ b/tests/framework/console/widgets/TableTest.php @@ -216,7 +216,8 @@ EXPECTED; ╔═══════════════╤═══════════════╤══════════════╗ ║ test1 │ test2 │ test3 ║ ╟───────────────┼───────────────┼──────────────╢ -║ testcontent1 │ testcontent2 │ testcontent3 ║ +║ • col1 │ testcontent2 │ testcontent3 ║ +║ • col2 │ │ ║ ╟───────────────┼───────────────┼──────────────╢ ║ testcontent21 │ testcontent22 │ • col1 ║ ║ │ │ • col2 ║ @@ -226,7 +227,7 @@ EXPECTED; $this->assertEqualsWithoutLE($expected, $table->setHeaders(['test1', 'test2', 'test3']) ->setRows([ - ['testcontent1', 'testcontent2', 'testcontent3'], + [['key1' => 'col1', 'key2' => 'col2'], 'testcontent2', 'testcontent3'], ['testcontent21', 'testcontent22', ['col1', 'col2']], ])->setScreenWidth(200)->run() );