Skip to content

Commit

Permalink
MDL-47466 calendar: fixed error ORA-01795 in calendar_get_events
Browse files Browse the repository at this point in the history
  • Loading branch information
tehanuyor committed Oct 14, 2014
1 parent a2ed10a commit c3f51a3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions calendar/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ function calendar_get_events($tstart, $tend, $users, $groups, $courses, $withdur
return array();
}

if((is_array($users) && !empty($users)) or is_numeric($users)) {
if ((is_array($users) && !empty($users)) or is_numeric($users)) {
// Events from a number of users
if(!empty($whereclause)) $whereclause .= ' OR';
list($insqlusers, $inparamsusers) = $DB->get_in_or_equal($users, SQL_PARAMS_NAMED);
Expand All @@ -703,7 +703,7 @@ function calendar_get_events($tstart, $tend, $users, $groups, $courses, $withdur
// No user at all, do nothing
}

if((is_array($groups) && !empty($groups)) or is_numeric($groups)) {
if ((is_array($groups) && !empty($groups)) or is_numeric($groups)) {
// Events from a number of groups
if(!empty($whereclause)) $whereclause .= ' OR';
list($insqlgroups, $inparamsgroups) = $DB->get_in_or_equal($groups, SQL_PARAMS_NAMED);
Expand All @@ -716,7 +716,7 @@ function calendar_get_events($tstart, $tend, $users, $groups, $courses, $withdur
}
// boolean false (no groups at all): we don't need to do anything

if((is_array($courses) && !empty($courses)) or is_numeric($courses)) {
if ((is_array($courses) && !empty($courses)) or is_numeric($courses)) {
if(!empty($whereclause)) $whereclause .= ' OR';
list($insqlcourses, $inparamscourses) = $DB->get_in_or_equal($courses, SQL_PARAMS_NAMED);
$whereclause .= " (groupid = 0 AND courseid $insqlcourses)";
Expand Down

0 comments on commit c3f51a3

Please sign in to comment.