ratings works with sqlite (unit tests pass, at least)

This commit is contained in:
Shish
2020-01-29 11:30:52 +00:00
parent aa1637d128
commit 41ce16f1b8
3 changed files with 6 additions and 6 deletions

View File

@ -225,16 +225,16 @@ class Ratings extends Extension
{
global $user;
if (is_null($event->term)) {
return;
}
$matches = [];
if (is_null($event->term) && $this->no_rating_query($event->context)) {
$set = Ratings::privs_to_sql(Ratings::get_user_default_ratings($user));
$event->add_querylet(new Querylet("rating IN ($set)"));
}
if (is_null($event->term)) {
return;
}
if (preg_match($this->search_regexp, strtolower($event->term), $matches)) {
$ratings = $matches[1] ? $matches[1] : $matches[2][0];
@ -420,7 +420,6 @@ class Ratings extends Extension
return $ratings;
}
public static function get_user_class_privs(User $user): array
{
global $config;