Commit 86a0b2f9 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Fix artefact chooser when there is no sort order

parent fa85e769
......@@ -1243,7 +1243,7 @@ class View {
if (method_exists($blocktypeclass, 'artefactchooser_get_sort_order')) {
$sortorder = call_static_method($blocktypeclass, 'artefactchooser_get_sort_order');
}
$artefacts = get_records_sql_array('SELECT a.* ' . $sql . ' WHERE ' . $select . ' ORDER BY ' . $sortorder, null, $offset, $limit);
$artefacts = get_records_sql_array('SELECT a.* ' . $sql . ' WHERE ' . $select . ($sortorder ? (' ORDER BY ' . $sortorder) : ''), null, $offset, $limit);
$totalartefacts = count_records_sql('SELECT COUNT(*) ' . $sql . ' WHERE ' . $select);
$result = '';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment