diff --git a/src/IDF/Form/IssueCreate.php b/src/IDF/Form/IssueCreate.php index 67afca7..65e74e5 100644 --- a/src/IDF/Form/IssueCreate.php +++ b/src/IDF/Form/IssueCreate.php @@ -173,6 +173,15 @@ class IDF_Form_IssueCreate extends Pluf_Form 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() { // Check that the status is in the list of official status diff --git a/src/IDF/Form/IssueUpdate.php b/src/IDF/Form/IssueUpdate.php index 0d36e72..3422551 100644 --- a/src/IDF/Form/IssueUpdate.php +++ b/src/IDF/Form/IssueUpdate.php @@ -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. */