Skip to content

Commit

Permalink
upgrade MDL-20933 Fixed warning if get_records_sql returned false rat…
Browse files Browse the repository at this point in the history
…her than an array
  • Loading branch information
Sam Hemelryk committed Nov 24, 2009
1 parent a27c35d commit f544529
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3264,9 +3264,10 @@ function xmldb_main_upgrade($oldversion=0) {
AND u.deleted = 0
AND rc.contextid = ".$systemcontext->id." AND u.auth<>'manual' AND u.auth<>'email'";

$adminusers = get_records_sql($sql);
foreach ($adminusers as $adminuser) {
delete_records('user_preferences', 'userid', $adminuser->id, 'name', 'auth_forcepasswordchange');
if ($adminusers = get_records_sql($sql)) {
foreach ($adminusers as $adminuser) {
delete_records('user_preferences', 'userid', $adminuser->id, 'name', 'auth_forcepasswordchange');
}
}
unset($adminusers);

Expand Down

0 comments on commit f544529

Please sign in to comment.