Skip to content

Commit 8765479

Browse files
authored
Merge pull request #1351 from phalcon/fix/#1320-scaffold-blank-page
#1320 - Fix blank page on Scaffold form page
2 parents fbc578a + d8bf344 commit 8765479

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

scripts/Phalcon/Web/Tools/Controllers/ScaffoldController.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
namespace WebTools\Controllers;
2323

24+
use PDOException;
2425
use Phalcon\Text;
2526
use Phalcon\Builder\Scaffold;
2627
use Phalcon\Mvc\Controller\Base;
@@ -107,10 +108,17 @@ public function generateAction()
107108
$this->tag->setDefault('templatesPath', $templatesPath);
108109
$this->tag->setDefault('schema', $this->dbUtils->resolveDbSchema());
109110

111+
try {
112+
$tables = $this->dbUtils->listTables();
113+
} catch (PDOException $PDOException) {
114+
$tables = [];
115+
$this->flash->error($PDOException->getMessage());
116+
}
117+
110118
$this->view->setVars(
111119
[
112120
'page_subtitle' => 'Generate code from template',
113-
'tables' => $this->dbUtils->listTables(),
121+
'tables' => $tables,
114122
'template_path' => $templatesPath,
115123
'templateEngines' => [
116124
'volt' => 'Volt',

0 commit comments

Comments
 (0)