From 0a8880105e29d480766279879b720a35965d4972 Mon Sep 17 00:00:00 2001 From: mirekmarek Date: Mon, 28 Nov 2022 10:22:48 +0100 Subject: [PATCH] Bug fixes --- application/Modules/Test/ORM/Controller/Main.php | 13 ++++++++++--- library/Jet/DataModel/Query/GroupBy.php | 4 ++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/application/Modules/Test/ORM/Controller/Main.php b/application/Modules/Test/ORM/Controller/Main.php index 498ac437b..45c41330d 100644 --- a/application/Modules/Test/ORM/Controller/Main.php +++ b/application/Modules/Test/ORM/Controller/Main.php @@ -27,9 +27,16 @@ class Controller_Main extends MVC_Controller_Default public function test_orm_Action(): void { $backends = []; - - $backends[DataModel_Backend::TYPE_MYSQL] = new DataModel_Backend_MySQL( (new DataModel_Backend_MySQL_Config()) ); - $backends[DataModel_Backend::TYPE_SQLITE] = new DataModel_Backend_SQLite( (new DataModel_Backend_SQLite_Config()) ); + + $mysql = new DataModel_Backend_MySQL( (new DataModel_Backend_MySQL_Config()) ); + if($mysql->isAvailable()) { + $backends[DataModel_Backend::TYPE_MYSQL] = $mysql; + } + + $sqlite = new DataModel_Backend_SQLite( (new DataModel_Backend_SQLite_Config()) ); + if($sqlite->isAvailable()) { + $backends[DataModel_Backend::TYPE_SQLITE] = $sqlite; + } $_tests = [ 'BasicSelect', diff --git a/library/Jet/DataModel/Query/GroupBy.php b/library/Jet/DataModel/Query/GroupBy.php index fcef9f3c1..0ad9ce455 100644 --- a/library/Jet/DataModel/Query/GroupBy.php +++ b/library/Jet/DataModel/Query/GroupBy.php @@ -99,9 +99,9 @@ public function key(): string /** * @see \Iterator */ - public function next(): mixed + public function next(): void { - return next( $this->items ); + next( $this->items ); } /**