[Bps-public-commit] rt-extension-spawnlinkedticketinqueue branch, master, updated. 0.05-1-ge1bb20b

Jim Brandt jbrandt at bestpractical.com
Tue Sep 17 15:51:12 EDT 2013


The branch, master has been updated
       via  e1bb20b9fdb46a6a407500c151956a4234142de2 (commit)
      from  6ad4e8236ec5985cc7f5a6afbd32d87774f42b54 (commit)

Summary of changes:
 html/Callbacks/SpawnLinkedTicket/Elements/ShowLinks/Default | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit e1bb20b9fdb46a6a407500c151956a4234142de2
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Tue Sep 17 15:46:33 2013 -0400

    Get ticket object from $Object for RT 4.2
    
    In RT 4.2 commit e4edcd64, $Ticket was switched to $Object to
    make it more generic and this changed the ARGS passed in the
    callback. Update to accept both $Ticket and $Object.

diff --git a/html/Callbacks/SpawnLinkedTicket/Elements/ShowLinks/Default b/html/Callbacks/SpawnLinkedTicket/Elements/ShowLinks/Default
index 684ce36..2645a50 100644
--- a/html/Callbacks/SpawnLinkedTicket/Elements/ShowLinks/Default
+++ b/html/Callbacks/SpawnLinkedTicket/Elements/ShowLinks/Default
@@ -51,7 +51,7 @@
 <table>
 <tr><td>
 <form action="<% RT->Config->Get('WebPath') ."/Helpers/SpawnLinkedTicket" %>" name="SpawnLinkedTicket">
-<input type="hidden" name="CloneTicket" value="<% $Ticket->id %>">
+<input type="hidden" name="CloneTicket" value="<% $Object->id %>">
 <input type="submit" value="<&|/l&>Create</&>" name="SpawnLinkedTicket">
 <select name="LinkType">
 <option value="DependsOn-new"><% loc('Depends on') %></option>
@@ -65,8 +65,14 @@
 <& /Elements/SelectQueue, ShowNullOption => 0, Name => 'CloneQueue' &>
 </form>
 </td></tr>
-
+<%init>
+# Before RT 4.2, the ShowLinks callback passed $Ticket in ARGS.
+# Continue to accept it for backward compatibility.
+$Object = $Ticket if $Ticket;
+return unless $Object and $Object->isa('RT::Ticket');
+</%init>
 <%ARGS>
 $Ticket => undef
+$Object => undef
 </%ARGS>
 

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list