diff --git a/scripts/Phalcon/Devtools/Version.php b/scripts/Phalcon/Devtools/Version.php index ee6d32536..9b6d2ad75 100644 --- a/scripts/Phalcon/Devtools/Version.php +++ b/scripts/Phalcon/Devtools/Version.php @@ -39,6 +39,6 @@ class Version extends PhVersion */ protected static function _getVersion() { - return [3, 4, 6, 0, 0]; + return [3, 4, 7, 0, 0]; } } diff --git a/scripts/Phalcon/Web/Tools/Controllers/ScaffoldController.php b/scripts/Phalcon/Web/Tools/Controllers/ScaffoldController.php index d74d7e898..c35c48432 100644 --- a/scripts/Phalcon/Web/Tools/Controllers/ScaffoldController.php +++ b/scripts/Phalcon/Web/Tools/Controllers/ScaffoldController.php @@ -21,6 +21,7 @@ namespace WebTools\Controllers; +use PDOException; use Phalcon\Text; use Phalcon\Builder\Scaffold; use Phalcon\Mvc\Controller\Base; @@ -107,10 +108,17 @@ public function generateAction() $this->tag->setDefault('templatesPath', $templatesPath); $this->tag->setDefault('schema', $this->dbUtils->resolveDbSchema()); + try { + $tables = $this->dbUtils->listTables(); + } catch (PDOException $PDOException) { + $tables = []; + $this->flash->error($PDOException->getMessage()); + } + $this->view->setVars( [ 'page_subtitle' => 'Generate code from template', - 'tables' => $this->dbUtils->listTables(), + 'tables' => $tables, 'template_path' => $templatesPath, 'templateEngines' => [ 'volt' => 'Volt', diff --git a/scripts/Phalcon/Web/Tools/Views/controllers/edit.volt b/scripts/Phalcon/Web/Tools/Views/controllers/edit.volt index a50d76a44..49781a44f 100644 --- a/scripts/Phalcon/Web/Tools/Views/controllers/edit.volt +++ b/scripts/Phalcon/Web/Tools/Views/controllers/edit.volt @@ -3,7 +3,7 @@ {{ content() }} {{ flashSession.output() }}