Index: openacs-4/packages/survey/survey.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/survey/survey.info,v diff -u -r1.17 -r1.17.2.1 --- openacs-4/packages/survey/survey.info 6 Nov 2013 07:33:53 -0000 1.17 +++ openacs-4/packages/survey/survey.info 8 Apr 2014 08:06:39 -0000 1.17.2.1 @@ -7,14 +7,14 @@ f f - + Dave Bauer Luke Pond User defined surveys with reporting. OpenACS Expanded functionality survey package derived from simple-survey. - + Index: openacs-4/packages/survey/www/admin/question-add-3-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/survey/www/admin/question-add-3-postgresql.xql,v diff -u -r1.2 -r1.2.22.1 --- openacs-4/packages/survey/www/admin/question-add-3-postgresql.xql 24 Sep 2002 02:22:25 -0000 1.2 +++ openacs-4/packages/survey/www/admin/question-add-3-postgresql.xql 8 Apr 2014 08:06:39 -0000 1.2.22.1 @@ -27,7 +27,7 @@ - select survey_choice_id_sequence.nextval as choice_id + select nextval as choice_id from survey_choice_id_sequence Index: openacs-4/packages/survey/www/admin/question-add-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/survey/www/admin/question-add-3.tcl,v diff -u -r1.6 -r1.6.2.1 --- openacs-4/packages/survey/www/admin/question-add-3.tcl 6 Nov 2013 07:33:54 -0000 1.6 +++ openacs-4/packages/survey/www/admin/question-add-3.tcl 8 Apr 2014 08:06:39 -0000 1.6.2.1 @@ -105,7 +105,10 @@ set sort_order [expr { $after + 1 }] db_dml renumber_sort_orders {} } else { - set sort_order [expr {[db_string max_question {}] + 1}] + set sort_order [db_string max_question {}] + if { $sort_order eq ""} { + set sort_order 1 + } } db_exec_plsql create_question {}