Forum OpenACS Q&A: Response to problems with new-ticket

Collapse
Posted by Al Walworth on
Carlo,

I'm not sure exactly what you did. You say you added a ticket for each and the clicked on 'create a ticket tracker', but logically you have to "create a ticket tracker" (which adds an id for the project into the ticket_projects table) before you can add a ticket for the project.

At any rate, once you've gone through the "create a ticket tracker" process for a project, it doesn't make sense to do it again: there's already an entry for the project in ticket_projects, and you want just a single entry per project there.

Consequently, intranet/projects/ticket-edit.tcl runs into trouble. It knows enough to not create a new id when one already exists, but then tries to use the new id it would create when used as intended in redirecting you to the ticket display page for the project.

If you'd prefer it to send you on to the project's ticket display when there's already an entry for the project in ticket_projects, you can add an "else" clause to the "if {$check == 0}{ ... }" section of ticket-edit.tcl by changing the final "}" line of that block to

} else { set new_id [database_to_tcl_string $db "select project_id from ticket_project_teams where team_id=$group_id"]
}