Skip to content

Commit

Permalink
Relax checks on link targets in create templates
Browse files Browse the repository at this point in the history
Prior to this change it wasn't possible to copy or add links to anything
other than tickets in a CreateTicket template.

This change removes a template-specific check on what might be a valid
link and trusts that the AddLink method knows how to validate what was
passed to it.
  • Loading branch information
bconry-bps committed Mar 27, 2024
1 parent 783c845 commit 581a2fc
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/RT/Action/CreateTickets.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1213,14 +1213,15 @@ sub PostProcess {

} elsif ( $link !~ m/^\d+$/ ) {
my $key = "create-$link";
if ( !exists $T::Tickets{$key} ) {
if ( exists $T::Tickets{$key} ) {
$RT::Logger->debug( "Building $type link for $link: "
. $T::Tickets{$key}->Id );
$link = $T::Tickets{$key}->Id;
}
else {
$RT::Logger->debug(
"Skipping $type link for $key (non-existent)");
next;
"Building $type link for $link");
}
$RT::Logger->debug( "Building $type link for $link: "
. $T::Tickets{$key}->Id );
$link = $T::Tickets{$key}->Id;
} else {
$RT::Logger->debug("Building $type link for $link");
}
Expand Down

0 comments on commit 581a2fc

Please sign in to comment.