Hello.

I wanted to use the ticket change hooks, and found a problem with the current code. This is how I get the code:


1. fossil update trunk
2. fossil merge tkt-change-hook
3. ./configure && make

I'm new to the Fossil code, so I'd appreciate an advice if I did that wrong.

The problem with the code, as far as I understood, is that the old ticket-change script is no longer called, and tktnew/tktedit pages rely on it. The main job seems to be done by the submit_ticket procedure, which was calling the old change hook (tkt.c, line ~625), which contained a single "return" operator. That made the Th_Render function call in tktnew_page/tktedit_page return TH_RETURN, which forced a redirect from tktnew/tktedit to tktview.

With the current code from the tkt-change-hook branch, the old change hook is not called and submitTicketCmd() always returns TH_OK, which disables the redirect and forces re-dispalying of the new/edit ticket page. The ticket is successfully changed or created, but the user stays on the same page, not seeing the change.

I fixed this by replacing the last return TH_OK in submitTicketCmd with return TH_RETURN.

Otherwise, the code works well and I can now use webhooks to send ticket change notification emails, the lack of which stopped me from using Fossil before.

Thanks.


--
Justin Forest
http://umonkey.net/
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to