[Rt-commit] r16528 - in rt/branches/3.999-DANGEROUS: . lib/RT/Model
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Fri Oct 24 04:15:04 EDT 2008
Author: sunnavy
Date: Fri Oct 24 04:15:04 2008
New Revision: 16528
Modified:
rt/branches/3.999-DANGEROUS/ (props changed)
rt/branches/3.999-DANGEROUS/lib/RT/Model/Ticket.pm
rt/branches/3.999-DANGEROUS/t/ticket/linking.t
Log:
r17380 at sunnavys-mb: sunnavy | 2008-10-24 15:17:10 +0800
name fix
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/Ticket.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/Ticket.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/Ticket.pm Fri Oct 24 04:15:04 2008
@@ -1868,7 +1868,7 @@
unless ( $args{ 'silent_' . $direction } ) {
my ( $Trans, $Msg, $TransObj ) = $self->_new_transaction(
- type => 'DeleteLink',
+ type => 'delete_link',
field => $LINKDIRMAP{ $args{'type'} }->{$direction},
old_value => $remote_uri->uri || $remote_link,
time_taken => 0
@@ -1881,7 +1881,7 @@
{
my $OtherObj = $remote_uri->object;
my ( $val, $Msg ) = $OtherObj->_new_transaction(
- type => 'DeleteLink',
+ type => 'delete_link',
field => $direction eq 'target'
? $LINKDIRMAP{ $args{'type'} }->{base}
: $LINKDIRMAP{ $args{'type'} }->{target},
Modified: rt/branches/3.999-DANGEROUS/t/ticket/linking.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/ticket/linking.t (original)
+++ rt/branches/3.999-DANGEROUS/t/ticket/linking.t Fri Oct 24 04:15:04 2008
@@ -48,11 +48,11 @@
Jifty->log->debug("Data is \$data");
open \$file, ">$filename" or die "couldn't open $filename";
- if (\$self->transaction_obj->type eq 'AddLink') {
+ if (\$self->transaction_obj->type eq 'add_link') {
Jifty->log->debug("add_link");
print \$file \$data+1, "\n";
}
- elsif (\$self->transaction_obj->type eq 'DeleteLink') {
+ elsif (\$self->transaction_obj->type eq 'delete_link') {
Jifty->log->debug("delete_link");
print \$file \$data-1, "\n";
}
@@ -78,7 +78,7 @@
template => $template->id,
stage => 'TransactionCreate',
queue => 0,
- custom_is_applicable_code => '$self->transaction_obj->type =~ /(Add|Delete)Link/;',
+ custom_is_applicable_code => '$self->transaction_obj->type =~ /(add|delete)_link/;',
custom_prepare_code => '1;',
custom_commit_code => $commit_code,
);
@@ -223,7 +223,7 @@
is(link_count($filename), 1, "scrips ok");
my $transactions = $ticket2->transactions;
-$transactions->limit( column => 'type', value => 'AddLink' );
+$transactions->limit( column => 'type', value => 'add_link' );
is( $transactions->count, 1, "Transaction found in other ticket" );
is( $transactions->first->field , 'ReferredToBy');
is( $transactions->first->new_value , $ticket->uri );
@@ -232,7 +232,7 @@
ok($id,$msg);
is(link_count($filename), 0, "scrips ok");
$transactions = $ticket2->transactions;
-$transactions->limit( column => 'type', value => 'DeleteLink' );
+$transactions->limit( column => 'type', value => 'delete_link' );
is( $transactions->count, 1, "Transaction found in other ticket" );
is( $transactions->first->field , 'ReferredToBy');
is( $transactions->first->old_value , $ticket->uri );
@@ -252,11 +252,11 @@
is(link_count($filename), 0, "scrips ok");
{
my $transactions = $ticket->transactions;
- $transactions->limit( column => 'type', value => 'AddLink' );
+ $transactions->limit( column => 'type', value => 'add_link' );
is( $transactions->count, 2, "Still two txns on the base" );
$transactions = $ticket2->transactions;
- $transactions->limit( column => 'type', value => 'AddLink' );
+ $transactions->limit( column => 'type', value => 'add_link' );
is( $transactions->count, 2, "Still two txns on the target" );
}
@@ -269,11 +269,11 @@
is(link_count($filename), 1, "scrips ok");
{
my $transactions = $ticket->transactions;
- $transactions->limit( column => 'type', value => 'AddLink' );
+ $transactions->limit( column => 'type', value => 'add_link' );
is( $transactions->count, 2, "still five txn on the base" );
$transactions = $ticket2->transactions;
- $transactions->limit( column => 'type', value => 'AddLink' );
+ $transactions->limit( column => 'type', value => 'add_link' );
is( $transactions->count, 3, "+1 txn on the target" );
}
@@ -286,11 +286,11 @@
is(link_count($filename), 1, "scrips ok");
{
my $transactions = $ticket->transactions;
- $transactions->limit( column => 'type', value => 'AddLink' );
+ $transactions->limit( column => 'type', value => 'add_link' );
is( $transactions->count, 3, "+1 txn on the base" );
$transactions = $ticket2->transactions;
- $transactions->limit( column => 'type', value => 'AddLink' );
+ $transactions->limit( column => 'type', value => 'add_link' );
is( $transactions->count, 3, "three txns on the target" );
}
($id,$msg) =$ticket->delete_link(type => 'RefersTo', target => $ticket2->id, silent_target => 1);
More information about the Rt-commit
mailing list