[Rt-commit] [rtir] 01/01: When linking a singular Incident Child type, delete other Links
Kevin Falcone
falcone at bestpractical.com
Mon Jun 17 19:56:01 EDT 2013
This is an automated email from the git hooks/post-receive script.
falcone pushed a commit to branch 2.9/incident-child-types
in repository rtir.
commit 935d6ee21546f7daaffe01035b439a0c6f48f353
Author: Kevin Falcone <falcone at bestpractical.com>
Date: Mon Jun 17 19:16:47 2013 -0400
When linking a singular Incident Child type, delete other Links
Investigations have long been limited to being applied to a Single
Incident. We've allowed Blocks to apply to multiple Incidents since
1.0.0 starting in 2.4.0 we allowed the same behavior for Incident Reports.
In c991958 a comment was added saying that this code looked "wrong
absolutly" for passing the correct arguments to ProcessTicketLinks.
In baa9f2c the comment was removed and the code 'fixed' to specify the
child and the incident id. However, this is completely incorrect.
Since 3.4 (years before this code was written) the Delete Link path has
ONLY accepted a target or a base because you're calling DeleteLink on
the other side of the link (you call it on the target object, passing
the base or call it on the base object passing the target).
This resulted in the delete never running for the entirety of the 2.4 or
2.6 series of RTIR. As a result, while you could never apply an
Investigation to two Incidents during Investigation creation, you could
backdoor yourself links to two Incidents by clicking Link on an
Investigation page and ignoring the "Can't specifiy both base and
target" message that shows up at the top of the page, before the message
saying that a link was created.
In 3.0, this code runs if the Incident Child Type isn't marked Multiple.
By default, this provides the intended behavior that Blocks and Incident
Reports may belong to multiple Incidents, but that Investigations may
not. If you've been relying on this backdoor behavior in 2.6, you can
specify explicitly that Investigations can belong to multiple Incidents
using the RTIR_IncidentChildren configuration.
---
html/RTIR/Incident/Display.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/html/RTIR/Incident/Display.html b/html/RTIR/Incident/Display.html
index 7216eb0..52500e2 100644
--- a/html/RTIR/Incident/Display.html
+++ b/html/RTIR/Incident/Display.html
@@ -172,7 +172,7 @@ my $DoLinks = sub {
my $incidents = RT::IR->Incidents( $child, Exclude => $parent );
while ( my $incident = $incidents->Next ) {
$deleted_links = 1;
- $args{'DeleteLink-'. $child->id .'-MemberOf-'. $incident->id } = '';
+ $args{'DeleteLink--MemberOf-'. $incident->id } = '';
}
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Rt-commit
mailing list