Commit 68d4f095 authored by Tristan Olive's avatar Tristan Olive
Browse files

Drupal: Log case in user preference import when ignored user is not found

(DBOINC-145)
parent 657198c0
......@@ -1150,7 +1150,15 @@ function boincimport_quarrels_op($boinc_user, &$context) {
$ignored_users = explode('|', trim($boinc_user->ignorelist, '|'));
foreach ($ignored_users as $ignored_user) {
$ignored_user_uid = boincuser_lookup_uid($ignored_user);
if (!$ignored_user_uid) continue;
if (!$ignored_user_uid) {
$context['results']['warning'][] = "{$uid}:{$ignored_user_uid}";
watchdog('boincimport',
'Error adding to ignore list of user @uid: No Drupal ID found for BOINC user @boinc_id',
array('@boinc_id' => $ignored_user, '@uid' => $uid),
WATCHDOG_WARNING
);
continue;
}
$user_ignored = db_query("
INSERT IGNORE INTO {ignore_user}
SET uid = '%d', iuid = '%d'",
......@@ -1160,7 +1168,12 @@ function boincimport_quarrels_op($boinc_user, &$context) {
$success = TRUE;
}
else {
$context['results']['warning'][$uid] = $ignored_user_uid;
$context['results']['warning'][] = "{$uid}:{$ignored_user_uid}";
watchdog('boincimport',
'Could not add user @ignored_uid to the ignore list of user @uid',
array('@ignored_uid' => $ignored_user_uid, '@uid' => $uid),
WATCHDOG_WARNING
);
}
}
......@@ -1210,16 +1223,6 @@ function boincimport_preferences_finished($success, $results, $operations) {
array('@count' => $total_imported, '@warn' => $total_warnings),
WATCHDOG_INFO
);
// Record any warnings
if ($total_warnings) {
foreach ($results['warning'] as $uid => $ignored_user_uid) {
watchdog('boincimport',
'Could not add user @ignored_uid to the ignore list of user @uid',
array('@ignored_uid' => $ignored_user_uid, '@uid' => $uid),
WATCHDOG_WARNING
);
}
}
// Set the preference import successful flag in the variable table
variable_set('boincimport_import_preferences_successful', '1');
$_SESSION['boincimport_stage_selected'] = 'private messages';
......
Supports Markdown
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