Forum OpenACS Q&A: Re: problem with index.tcl: Too many positional parameters specified while executing

Hello

Also I have the same problem here's the part of the code attached

ad_page_contract {
 This page will display a list of to do items belonging to the current user.
} {
 orderby:optional
}

set page_title "My To Do List"
set user_id [ad_conn user_id]

template::list::create -name todo_list\
 -multirow todo_list_mr\
 -elements {
      title {
         label "Task"
         link_url_col item_url
         link_html {title "Click to view this item details" }
      }
      due_date_pretty {
      label "Due Date"
      }
     status_text {
    label "Status"
     }
    creation_date_pretty {
      label "Creation Date"
    }
    view {
       display_template "View"
       link_url_col item_url
      }
    delete {
        display_template "Delete"
        link_url_col delete_url
    }
    completed {
        display_template "Mark Completed"
        link_url_col completed_url
    }
    cancel {
        display_template "Cancel"
        link_url_col cancel_url
    }
 }
-orderby {
  title {orderby title}
  due_date_pretty {orderby due_date}
  status_text {orderby status}
  creation_date_pretty {orderby creation_date}
} -actions {
  "Add New Task" "todo-ae" "Click here to add a new item to the list"
}

if {[exists_and_not_null orderby]} {
    set orderby_clause "ORDER BY [template::list::orderby_clause -name todo_list]"
} else {
    set orderby_clause "ORDER BY due_date asc"
}

db_multirow -extend { item_url delete_url cancel_url completed_url status_text } todo_list_mr todo_list_mr \
"select item_id,
        title,
        due_date,        
        to_char(due_date, 'Month DD YYYY ') as due_date_pretty,
        creation_date,        
        to_char(creation_date, 'Month DD YYYY ') as creation_date_pretty,
        status
  from todo_item
  where owner_id = :user_id
  $orderby_clause

" {

  set form_mode display
  set item_url "todo-ae?[export_vars -url { item_id form_mode }]"

  switch $status {
   p {set status_text "Pending"}
   c {set status_text "Completed"}  
   x {set status_text "Canceled"}
   default {set status_text "Unknown" }
  }

  set return_url [util_get_current_url]
  set delete_url "todo-delete?[export_vars -url {item_id return_url}]"

  if { $status != "c" } {
      set new_status completed
      set completed_url "todo-update-item?[export_vars -url {item_id new_status return_url}]"
  }
  if { $status != "x" } {
      set new_status canceled
      set cancel_url "todo-update-item?[export_vars -url {item_id new_status return_url}]"
   }
}

thanks ...

Hi Jhon

you are missing a backslash on the line before the -orderby. Also I think you should have a space before the other backslashes.

Brian

Hi Brian

thank you very much for responding, corrected as you said and indeed that was the error