Browse Source

[svn r17437] logic changes - it was added restriction in the condition - (see FS#3390)

Isaac Flores 16 years ago
parent
commit
8e61ffff25
1 changed files with 3 additions and 0 deletions
  1. 3 0
      main/gradebook/lib/be/category.class.php

+ 3 - 0
main/gradebook/lib/be/category.class.php

@@ -250,6 +250,9 @@ class Category implements GradebookItem
      * Insert this category into the database
      */
 	public function add() {
+		if ( isset($this->name) && -1===$this->name) {
+			return false;
+		}
 		if (isset($this->name) && isset($this->user_id) && isset($this->weight) && isset($this->visible)) {
 			$tbl_grade_categories = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_CATEGORY);
 			$sql = 'INSERT INTO '.$tbl_grade_categories