Commit 9128cadf authored by Tristan Olive's avatar Tristan Olive

Remove remnants from XML when clearing preference sets

If a preference set is established for a user (e.g. Home, Work), it is stored in the database with a <venue> wrapper. If all of these sets are then cleared from the account, a <venue/> tag was remaining, which causes parser issues in BOINC. Remove the <venue> element when all preference sets are cleared.

(DBOINCP-108)
parent a6913a75
......@@ -762,6 +762,11 @@ function boincwork_save_prefs($prefs, $type = 'general', $venue = null, $account
else {
// If prefs is null, clear out this preference set
unset($main_prefs['venue'][$key]);
if (count($main_prefs['venue']) == 0) {
// If that was the only preference set configured, unset the
// venue tag altogether
unset($main_prefs['venue']);
}
}
$new_venue = false;
break;
......
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