Browse Source

[svn r16453] fix a bug introduced by my previous commit : we couldn't edit a survey anymore

Eric Marguin 16 years ago
parent
commit
52acf75183
1 changed files with 2 additions and 2 deletions
  1. 2 2
      main/survey/survey.lib.php

+ 2 - 2
main/survey/survey.lib.php

@@ -24,7 +24,7 @@
 *	@package dokeos.survey
 * 	@author Patrick Cool <patrick.cool@UGent.be>, Ghent University: cleanup, refactoring and rewriting large parts (if not all) of the code
 	@author Julio Montoya Armas <gugli100@gmail.com>, Dokeos: Personality Test modification and rewriting large parts of the code
-* 	@version $Id: survey.lib.php 16450 2008-10-08 07:44:27Z elixir_inter $
+* 	@version $Id: survey.lib.php 16453 2008-10-08 08:26:33Z elixir_inter $
 *
 * 	@todo move this file to inc/lib
 * 	@todo use consistent naming for the functions (save vs store for instance)
@@ -263,7 +263,7 @@ class survey_manager
 		{ 
 			
 			// check if the code doesn't soon exists in this language
-			$sql = 'SELECT 1 FROM '.$table_survey.' WHERE code="'.Database::escape_string($values['survey_code']).'" AND lang="'.Database::escape_string($values['survey_language']).'"';
+			$sql = 'SELECT 1 FROM '.$table_survey.' WHERE code="'.Database::escape_string($values['survey_code']).'" AND lang="'.Database::escape_string($values['survey_language']).'" AND survey_id!='.intval($values['survey_id']);
 			$rs = api_sql_query($sql, __FILE__, __LINE__);
 			if(Database::num_rows($rs)>0)
 			{