Should branch tktnew_template be merged into trunk?
(1) By Jörgen Kosche (jkosche) on 2025-03-23 11:55:38 [source]
Based on forumpost d53ffe93722333b1 I created the branch tktnew_template. The changes make a functionality accessible, that fossil already had: if you call /tktnew/hash
with a hash of an existing ticket, the fields in the form are prefilled with the values in the existing ticket.
The branch does the following changes:
- add a submenu Copy Ticket to
/tktview
that accesses this functionality - sets private contact always to the contact of the current user (shouldn't be copies from the template)
- adds fields priority and subsystem to new ticket, if user has TktWrite capabilites (which would allow them to edit these fields in
/tktedit
anyways) - adds a button 'Submit and New' similar to Redmine, which allows to submit the current ticket and instantly start a new one with the fields prefilled (useful if you type in a list given from the client)
I think these changes are OK, I think they can be merged to trunk. What do you all think?
(2) By Stephan Beal (stephan) on 2025-03-23 12:18:18 in reply to 1 [link] [source]
I think these changes are OK, I think they can be merged to trunk. What do you all think?
FWIW, it looks good to me and provides a useful capability with minimal new code. IMO, merge it, but let's wait a few days for objections before doing so.
(3) By Jörgen Kosche (jkosche) on 2025-03-26 17:03:41 in reply to 1 [link] [source]
A few days are gone, anyone having objections to merge this tomorrow?
(4) By MG (mgr) on 2025-03-26 19:03:06 in reply to 1 [link] [source]
Are these changes (like settings priority, subsystem, private contac fields) hardcoded or changes to TH1 defaults?
If hardcoded, that would break customized setups where there are no such fields in the ticket setup. Stuff does already break if there is no column 'title' in the ticket setup, as this is hardcoded in C at some places ... no more of these, please!
(5.2) By Jörgen Kosche (jkosche) on 2025-03-26 19:15:22 edited from 5.1 in reply to 4 [link] [source]
Filtering out the private contact is hardcoded in C, where it was set in the first place. 'Submit and New' has parts changes in TH1 and parts in C (to actually make it work both parts are needed). The submenu and inclusion of priority and subsystem in new tickets is done in the default TH1. Actually I had first made the submenu in C, then realized that as Th1 it allows more configurability and changed it.
EDIT: to be clear, the private contact was always in the form, but previously it would be filled with the contact of the cloned ticket, which didn't seem right. You can edit away private contact still. I think nothing of these changes should break customized TH1 forms. If you remove private contact from the TH1, it works as the C code only removes the copy of the contact from the cloned ticket and allows the (already existing) code to fill the template with the current users email.
(6) By Jörgen Kosche (jkosche) on 2025-03-26 19:20:05 in reply to 4 [link] [source]
Also, what breaks if the title column is removed? Maybe that can be fixed.
(9) By MG (mgr) on 2025-03-31 16:18:20 in reply to 6 [link] [source]
My workaround is to declare a virtual column 'title' in the 'ticket' table.
IIRC, the offending parts are:
- the ticket-title-expr setting, which contrary to its name can not be an expression like eg.
substr(some_other_field,1,20)
but must be a pure column name (default = title). Not having title (or another column as set accordingly) make rebuilding the ticket table crash, due to this part of the code. - the code here breaks the /ambiguous webpage which is used be eg. /info. It has a hardcoded query on title, which must exist in TICKET but not in TICKETCHNG (then the query fails because title in the select is ambiguos by itself). So when removing 'title' from the TICKETS table, this breaks ambiguous /info/ pages even if the ticketsystem is not used at all ...
(11) By Jörgen Kosche (jkosche) on 2025-04-02 21:09:59 in reply to 9 [link] [source]
I noted this in a ticket. I want to explore the issue. I cannot promise that I will fix it, but I will try to understand what happens here. The ticket is to track this.
(13) By MG (mgr) on 2025-04-02 21:57:12 in reply to 11 [link] [source]
Or instead just document that 'title' is mandatory (as is tkt_id ...) in the ticket table ... and that it can be a virtual column, eg something along
title TEXT GENERATED ALWAYS AS ( printf('%s %s',other,columns,...) ) VIRTUAL,
which also makes (the not exactly working as called) ticket-title-expr
superfluous
(12) By MG (mgr) on 2025-04-02 21:48:32 in reply to 9 [link] [source]
There might be a third one: The construction of the FTS5 search index could depend on hard-coded 'title' as well. By that time, I already had the virtual column in place ...
(7) By Jörgen Kosche (jkosche) on 2025-03-30 13:04:21 in reply to 4 [link] [source]
I think my answer covered your concerns and I think the changes in the branch don't create more issues that you fear. So if you or others don't raise any other concerns, I still would go ahead and merge this.
(8) By MG (mgr) on 2025-03-31 15:57:52 in reply to 7 [link] [source]
Yes, I did test that branch with one of my (quite heavily customized) tickets setups and no additional problems found
(10) By Jörgen Kosche (jkosche) on 2025-04-02 21:02:10 in reply to 8 [link] [source]
Thanks for your tests. I merged the branch.