Commit 362aaae7 authored by Robert Lyon's avatar Robert Lyon

Public group with allow submissions ticked causes error (Bug #1310761)

This is due to the dummy 'root' user having the same id, which is 0, as
an anonymous user.

Needed to not include the dummy 'root' profile page in the get views
and collections db call.

Change-Id: Id349bdb193e510df5ecbc6f76a6324dbc15a2a57
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 63e0484d
......@@ -4817,7 +4817,10 @@ class View {
function get_views_and_collections($owner=null, $group=null, $institution=null, $matchconfig=null, $includeprofile=true, $submittedgroup=null) {
$excludelocked = $group && group_user_access($group) != 'admin';
// Anonymous public viewing of a group with 'Allow submissions' checked needs to avoid including the dummy root profile page.
if ($owner == '0') {
$includeprofile = false;
}
$sql = "
SELECT v.id, v.type, v.title, v.accessconf, v.ownerformat, v.startdate, v.stopdate, v.template,
v.owner, v.group, v.institution, v.urlid, v.submittedgroup, v.submittedhost, " .
......
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