Skip to content

Commit

Permalink
Merge pull request #8173 from kenjis/fix-ShowTableInfo-promptByKey
Browse files Browse the repository at this point in the history
fix: Undefined array key error in `spark db:table`
  • Loading branch information
kenjis authored Nov 9, 2023
2 parents a859ba0 + eb908d1 commit c2f341a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions system/Commands/Database/ShowTableInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ public function run(array $params)
$limitRows = (int) ($params['limit-rows'] ?? 10);
$limitFieldValue = (int) ($params['limit-field-value'] ?? 15);

if (! in_array($tableName, $tables, true)) {
while (! in_array($tableName, $tables, true)) {
$tableNameNo = CLI::promptByKey(
['Here is the list of your database tables:', 'Which table do you want to see?'],
$tables,
'required'
);
CLI::newLine();

$tableName = $tables[$tableNameNo];
$tableName = $tables[$tableNameNo] ?? null;
}

if (array_key_exists('metadata', $params)) {
Expand Down

0 comments on commit c2f341a

Please sign in to comment.