From a5a3937a5345b587cfd301a156b29ff2d50dbcf1 Mon Sep 17 00:00:00 2001 From: Elmar Ludwig Date: Fri, 8 Sep 2023 10:24:59 +0000 Subject: fix quotes in SQL, fixes #1443 Closes #1443 Merge request studip/studip!2126 --- lib/classes/JsonApi/Routes/Blubber/ThreadsIndex.php | 2 +- lib/classes/sidebar/RoomSearchWidget.class.php | 2 +- tests/jsonapi/BlubberThreadsIndexTest.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/classes/JsonApi/Routes/Blubber/ThreadsIndex.php b/lib/classes/JsonApi/Routes/Blubber/ThreadsIndex.php index 74f4069..91cfa89 100644 --- a/lib/classes/JsonApi/Routes/Blubber/ThreadsIndex.php +++ b/lib/classes/JsonApi/Routes/Blubber/ThreadsIndex.php @@ -77,7 +77,7 @@ class ThreadsIndex extends JsonApiController private function getPublicThreads(\User $observer) { return $this->paginateThreads( - $this->upgradeAndFilterThreads($observer, \BlubberThread::findBySQL('context_type = "public"')) + $this->upgradeAndFilterThreads($observer, \BlubberThread::findBySQL("context_type = 'public'")) ); } diff --git a/lib/classes/sidebar/RoomSearchWidget.class.php b/lib/classes/sidebar/RoomSearchWidget.class.php index c1a3d6a..f12e73e 100644 --- a/lib/classes/sidebar/RoomSearchWidget.class.php +++ b/lib/classes/sidebar/RoomSearchWidget.class.php @@ -22,7 +22,7 @@ class RoomSearchWidget extends SidebarWidget ] ); - $resource_categories = ResourceCategory::findBySQL('`class_name` ="Room" ORDER by `name`'); + $resource_categories = ResourceCategory::findBySQL("class_name = 'Room' ORDER by name"); $categories = [ '' => _('Alle Kategorien') ]; diff --git a/tests/jsonapi/BlubberThreadsIndexTest.php b/tests/jsonapi/BlubberThreadsIndexTest.php index ec2929c..ab6d200 100644 --- a/tests/jsonapi/BlubberThreadsIndexTest.php +++ b/tests/jsonapi/BlubberThreadsIndexTest.php @@ -58,7 +58,7 @@ class BlubberThreadsIndexTest extends \Codeception\Test\Unit return count( $this->upgradeAndFilterThreads( $credentials, - \BlubberThread::findBySQL('context_type = "public" AND visible_in_stream') + \BlubberThread::findBySQL("context_type = 'public' AND visible_in_stream") ) ); }); -- cgit v1.0