diff --git a/favourites/classes/privacy/provider.php b/favourites/classes/privacy/provider.php index 74c9b28fe02..0d947394566 100644 --- a/favourites/classes/privacy/provider.php +++ b/favourites/classes/privacy/provider.php @@ -87,7 +87,7 @@ class provider implements \core_privacy\local\metadata\provider, \core_privacy\l WHERE userid = :userid AND component = :component"; if (!is_null($itemtype)) { - $sql .= "AND itemtype = :itemtype"; + $sql .= " AND itemtype = :itemtype"; } $params = ['userid' => $userid, 'component' => $component, 'itemtype' => $itemtype]; $contextlist->add_from_sql($sql, $params); diff --git a/favourites/tests/repository_test.php b/favourites/tests/repository_test.php index 724526197f7..a99f30fd7cc 100644 --- a/favourites/tests/repository_test.php +++ b/favourites/tests/repository_test.php @@ -201,7 +201,7 @@ class favourite_repository_testcase extends advanced_testcase { // Try to get a favourite we know doesn't exist. // We expect an exception in this case. $this->expectException(dml_exception::class); - $favouritesrepo->find(1); + $favouritesrepo->find(0); } /** @@ -414,7 +414,7 @@ class favourite_repository_testcase extends advanced_testcase { $this->assertTrue($favouritesrepo->exists($createdfavourite->id)); // Verify exists returns false for non-existent favourite. - $this->assertFalse($favouritesrepo->exists(1)); + $this->assertFalse($favouritesrepo->exists(0)); } /**