Skip to content

Commit

Permalink
MDL-66631 mod_forum: make get_from_discussion_ids use new fn
Browse files Browse the repository at this point in the history
  • Loading branch information
lameze authored and rezaies committed Oct 18, 2019
1 parent 718d7a4 commit 6e23f29
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions mod/forum/classes/local/vaults/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,26 +134,7 @@ public function get_from_discussion_ids(
return [];
}

$alias = $this->get_table_alias();

list($insql, $params) = $this->get_db()->get_in_or_equal($discussionids, SQL_PARAMS_NAMED);
[
'where' => $privatewhere,
'params' => $privateparams,
] = $this->get_private_reply_sql($user, $canseeprivatereplies);

$wheresql = "{$alias}.discussion {$insql} {$privatewhere}";

if ($orderby) {
$orderbysql = $alias . '.' . $orderby;
} else {
$orderbysql = '';
}

$sql = $this->generate_get_records_sql($wheresql, $orderbysql);
$records = $this->get_db()->get_records_sql($sql, array_merge($params, $privateparams));

return $this->transform_db_records_to_entities($records);
return $this->get_from_filters($user, ['discussionids' => $discussionids], $canseeprivatereplies, $orderby);
}

/**
Expand Down

0 comments on commit 6e23f29

Please sign in to comment.