Commit 93c3d2f8 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Don't try to fetch user's institution in non-admin search

parent 8d255c29
...@@ -118,7 +118,7 @@ class PluginSearchInternal extends PluginSearch { ...@@ -118,7 +118,7 @@ class PluginSearchInternal extends PluginSearch {
if ($count > 0) { if ($count > 0) {
$data = get_records_sql_array(' $data = get_records_sql_array('
SELECT DISTINCT ON (u.firstname, u.lastname, u.id) SELECT DISTINCT ON (u.firstname, u.lastname, u.id)
u.id, u.username, u.institution, u.firstname, u.lastname, u.preferredname, u.email, u.staff u.id, u.username, u.firstname, u.lastname, u.preferredname, u.email, u.staff
FROM {artefact} a FROM {artefact} a
INNER JOIN {usr} u ON u.id = a.owner INNER JOIN {usr} u ON u.id = a.owner
WHERE WHERE
...@@ -196,7 +196,7 @@ class PluginSearchInternal extends PluginSearch { ...@@ -196,7 +196,7 @@ class PluginSearchInternal extends PluginSearch {
// way is to rewrite the query using a self join on the usr table. // way is to rewrite the query using a self join on the usr table.
$data = get_records_sql_array(' $data = get_records_sql_array('
SELECT DISTINCT SELECT DISTINCT
u.id, u.username, u.institution, u.firstname, u.lastname, u.preferredname, u.email, u.staff u.id, u.username, u.firstname, u.lastname, u.preferredname, u.email, u.staff
FROM {artefact} a FROM {artefact} a
INNER JOIN {usr} u ON u.id = a.owner INNER JOIN {usr} u ON u.id = a.owner
WHERE WHERE
......
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