Commit 2a5832a8 authored by Oliver Bock's avatar Oliver Bock

DBOINCP-119: fix BOINC API calls in boincteam module (part 2)

* Also fixed a bug: $name was always uninitialized during team lookup rendering the duplicate check ineffective
* Pending: the current implementation doesn't allow the team info to be updated unless the team name is changed as well - this needs fixing!
parent f5d615aa
......@@ -374,15 +374,16 @@ function boincteam_edit_form(&$form_state, $team_id) {
function boincteam_edit_form_validate($form, &$form_state) {
$values = $form_state['values'];
if (!$values['name']) {
$name = $values['name'];
if (!$name) {
form_set_error('name', t('Team name is required.'));
}
else {
require_boinc('team');
if (lookup_team_name($name)) {
require_boinc('boinc_db');
if (BoincTeam::lookup_name($name)) {
form_set_error('name', t('A team named "@name" already exists.',
array('@name' => $values['name'])));
array('@name' => $name)));
}
}
......
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