Fixed to prevent entering empty bug reports.

This commit is contained in:
Loic d'Anterroches 2008-12-23 11:20:08 +01:00
parent d292678759
commit 4f682c2e93
2 changed files with 18 additions and 0 deletions

View File

@ -173,6 +173,15 @@ class IDF_Form_IssueCreate extends Pluf_Form
return $this->cleaned_data; return $this->cleaned_data;
} }
function clean_content()
{
$content = trim($this->cleaned_data['content']);
if (strlen($content) == 0) {
throw new Pluf_Form_Invalid(__('You need to provide a description of the issue.'));
}
return $content;
}
function clean_status() function clean_status()
{ {
// Check that the status is in the list of official status // Check that the status is in the list of official status

View File

@ -140,6 +140,15 @@ class IDF_Form_IssueUpdate extends IDF_Form_IssueCreate
} }
} }
function clean_content()
{
$content = trim($this->cleaned_data['content']);
if (!$this->show_full and strlen($content) == 0) {
throw new Pluf_Form_Invalid(__('You need to provide a description of the issue.'));
}
return $content;
}
/** /**
* We check that something is really changed. * We check that something is really changed.
*/ */