Forum .LRN Q&A: LORSM Package problem changing Start and End page

Hello, the following error is also happening to me:

In the admin page(below more info) it says MESSAGE KEY MISSING: 'lorsm.Start_Page' and MESSAGE KEY MISSING: 'lorsm.End_Page'

It gives the option to set it. So, I'm able to set one, but when I try to set the other the following error arise:

Error: POST http://localhost:8000/dotlrn/classes/dev/dev.dev/dev/lorsm/admin/set-custom-page?
referred by "http://localhost:8000/dotlrn/classes/dev/dev.dev/dev/lorsm/admin/set-custom-page?man_id=3231&type=end";
Database operation "dml" failed
(exception ERROR, "ERROR: duplicate key value violates unique constraint "lors_st_end_pgs_man_id_pk"
")

while executing
"ns_pg_bind dml nsdb0 {
insert into lorsm_custom_pages
(man_id,page_id,type)
values
(:man_id,:i..."
("uplevel" body line 1)
invoked from within
"uplevel $ulevel [list ns_pg_bind $type $db $sql]"
("postgresql" arm line 2)
invoked from within
"switch $driverkey {
oracle {
return [uplevel $ulevel [list ns_ora $type $db $sql] $args]
}
..."
invoked from within
"db_exec dml $db $full_statement_name $sql"
("uplevel" body line 2)
invoked from within
"uplevel 1 $code_block "
invoked from within
"db_with_handle -dbn $dbn db {
db_exec dml $db $full_statement_name $sql
}"
(procedure "db_dml" line 100)
invoked from within
"db_dml add_page {}"
(procedure "lorsm::set_custom_page" line 4)
invoked from within
"lorsm::set_custom_page -man_id $man_id -item_id $item_id -type $type"
("uplevel" body line 8)
invoked from within
"uplevel #$level $on_submit"
("1" arm line 620)
invoked from within
"switch $errno {
0 {
# TCL_OK
}
1 {
# TCL_E..."
(procedure "ad_form" line 640)
invoked from within
"ad_form -name set-page -export {man_id ims_item_id type} -form {
{ims_item_id:text(select),optional {label $label} {options $options}}

..."
("uplevel" body line 17)
invoked from within
"uplevel {
ad_page_contract {
Set a start/end page from existing ims_cp_item
} {
man_id
type
{return_url ""}
}

set label [_ "lorsm.Cho..."
(procedure "code::tcl::/var/lib/aolserver/mdotlrn2.5/packages/lorsm/www/..." line 2)
invoked from within
"code::tcl::$__adp_stub"
invoked from within
"if { [file exists $__adp_stub.tcl] } {

# ensure that data source preparation procedure exists and is up-to-date
adp_init tcl $__adp_stub
..."
("uplevel" body line 3)
invoked from within
"uplevel {

if { [file exists $__adp_stub.tcl] } {

# ensure that data source preparation procedure exists and is up-to-date
adp_init t..."
(procedure "adp_prepare" line 2)
invoked from within
"adp_prepare"
invoked from within
"template::adp_parse [file root [ad_conn file]] {}"
(procedure "adp_parse_ad_conn_file" line 6)
invoked from within
"$handler"
("uplevel" body line 2)
invoked from within
"uplevel $code"
invoked from within
"ad_try {
$handler
} ad_script_abort val {
# do nothing
}"
invoked from within
"rp_serve_concrete_file [ad_conn file]"
(procedure "rp_serve_abstract_file" line 60)
invoked from within
"rp_serve_abstract_file "$root/[ad_conn extra_url]""
("uplevel" body line 2)
invoked from within
"uplevel $code"
invoked from within
"ad_try {
rp_serve_abstract_file "$root/[ad_conn extra_url]"
set tcl_url2file([ad_conn url]) [ad_conn file]
set tcl..."

Thanks

HI Rafael,

To fix it, run the following in psql:

dotlrn=# alter table lorsm_custom_pages drop constraint lors_st_end_pgs_man_id_pk;

dotlrn=# alter table lorsm_custom_pages add constraint lcp_man_id_type_pk primary key (man_id, type);

it will fix the error but I don't know if when running the course the start and end pages will be shown or not.