[Rt-commit] rt branch, 4.4/ocfv-disabled-flag, created. rt-4.2.5-210-g54072f9
? sunnavy
sunnavy at bestpractical.com
Wed Nov 26 06:46:15 EST 2014
The branch, 4.4/ocfv-disabled-flag has been created
at 54072f917e222ba24871fd28fcff66986df961d9 (commit)
- Log -----------------------------------------------------------------
commit 54072f917e222ba24871fd28fcff66986df961d9
Author: sunnavy <sunnavy at bestpractical.com>
Date: Fri Oct 24 22:44:35 2014 +0800
consistently use with_disabled_column for ObjectCustomFieldValues too
no need to use an extra flag("find_expired_rows")
Fixes: #20766
diff --git a/etc/upgrade/4.0.19/content b/etc/upgrade/4.0.19/content
index 31e4d9f..726d196 100644
--- a/etc/upgrade/4.0.19/content
+++ b/etc/upgrade/4.0.19/content
@@ -17,7 +17,7 @@ our @Initial = (
sub {
use RT::ObjectCustomFieldValues;
my $ocfvs = RT::ObjectCustomFieldValues->new(RT->System);
- $ocfvs->{'find_expired_rows'} = 1;
+ $ocfvs->{'find_disabled_rows'} = 1;
$ocfvs->Limit( FIELD => 'ObjectType', VALUE => 'RT::FM::Article' );
while ( my $ocfv = $ocfvs->Next ) {
my ($ret, $msg) = $ocfv->__Set( Field => 'ObjectType', Value => 'RT::Article' );
diff --git a/etc/upgrade/4.2.2/content b/etc/upgrade/4.2.2/content
index 762289a..3a6adaf 100644
--- a/etc/upgrade/4.2.2/content
+++ b/etc/upgrade/4.2.2/content
@@ -17,7 +17,7 @@ our @Initial = (
sub {
use RT::ObjectCustomFieldValues;
my $ocfvs = RT::ObjectCustomFieldValues->new(RT->System);
- $ocfvs->{'find_expired_rows'} = 1;
+ $ocfvs->{'find_disabled_rows'} = 1;
$ocfvs->Limit( FIELD => 'ObjectType', VALUE => 'RT::FM::Article' );
while ( my $ocfv = $ocfvs->Next ) {
my ($ret, $msg) = $ocfv->__Set( Field => 'ObjectType', Value => 'RT::Article' );
diff --git a/etc/upgrade/upgrade-articles.in b/etc/upgrade/upgrade-articles.in
index 17128e9..cb11552 100644
--- a/etc/upgrade/upgrade-articles.in
+++ b/etc/upgrade/upgrade-articles.in
@@ -168,7 +168,7 @@ sub copy_tables {
use RT::ObjectCustomFieldValues;
my $ocfvs = RT::ObjectCustomFieldValues->new(RT->System);
$ocfvs->Limit( FIELD => 'ObjectType', VALUE => 'RT::FM::Article' );
- $ocfvs->{'find_expired_rows'} = 1;
+ $ocfvs->{'find_disabled_rows'} = 1;
while ( my $ocfv = $ocfvs->Next ) {
my ($ret, $msg) = $ocfv->__Set( Field => 'ObjectType', Value => 'RT::Article' );
warn "Updated CF ".$ocfv->__Value('CustomField')." Value for Article ".$ocfv->__Value('ObjectId');
diff --git a/lib/RT/Migrate/Serializer.pm b/lib/RT/Migrate/Serializer.pm
index 0866dea..15ca4f6 100644
--- a/lib/RT/Migrate/Serializer.pm
+++ b/lib/RT/Migrate/Serializer.pm
@@ -198,7 +198,7 @@ sub PushCollections {
}
elsif ($collection->isa('RT::ObjectCustomFieldValues')) {
# FindAllRows (find_disabled_rows) isn't used by OCFVs
- $collection->{find_expired_rows} = 1;
+ $collection->{find_disabled_rows} = 1;
}
if ($self->{Incremental}) {
diff --git a/lib/RT/ObjectCustomFieldValues.pm b/lib/RT/ObjectCustomFieldValues.pm
index ec3155d..6175cd9 100644
--- a/lib/RT/ObjectCustomFieldValues.pm
+++ b/lib/RT/ObjectCustomFieldValues.pm
@@ -59,6 +59,7 @@ sub Table { 'ObjectCustomFieldValues'}
sub _Init {
my $self = shift;
+ $self->{'with_disabled_column'} = 1;
# By default, order by SortOrder
$self->OrderByCols(
@@ -162,25 +163,23 @@ sub HasEntry {
sub _DoSearch {
my $self = shift;
-
- # unless we really want to find disabled rows,
- # make sure we're only finding enabled ones.
- unless ( $self->{'find_expired_rows'} ) {
- $self->LimitToEnabled();
+
+ if ( exists $self->{'find_expired_rows'} ) {
+ RT->Deprecated( Arguments => "find_expired_rows", Instead => 'find_disabled_rows', Remove => '4.6' );
+ $self->{'find_disabled_rows'} = $self->{'find_expired_rows'};
}
-
+
return $self->SUPER::_DoSearch(@_);
}
sub _DoCount {
my $self = shift;
-
- # unless we really want to find disabled rows,
- # make sure we're only finding enabled ones.
- unless ( $self->{'find_expired_rows'} ) {
- $self->LimitToEnabled();
+
+ if ( exists $self->{'find_expired_rows'} ) {
+ RT->Deprecated( Arguments => "find_expired_rows", Instead => 'find_disabled_rows', Remove => '4.6' );
+ $self->{'find_disabled_rows'} = $self->{'find_expired_rows'};
}
-
+
return $self->SUPER::_DoCount(@_);
}
diff --git a/lib/RT/Record.pm b/lib/RT/Record.pm
index 6bb0a7e..d0426fc 100644
--- a/lib/RT/Record.pm
+++ b/lib/RT/Record.pm
@@ -2440,7 +2440,7 @@ sub FindDependencies {
and $self->can("CustomFieldValues") )
{
$objs = $self->CustomFieldValues; # Actually OCFVs
- $objs->{find_expired_rows} = 1;
+ $objs->{find_disabled_rows} = 1;
$deps->Add( in => $objs );
}
diff --git a/lib/RT/Shredder/Record.pm b/lib/RT/Shredder/Record.pm
index ebfa7c2..d6a497b 100644
--- a/lib/RT/Shredder/Record.pm
+++ b/lib/RT/Shredder/Record.pm
@@ -128,7 +128,7 @@ sub __DependsOn
# Object custom field values
my $objs = $self->CustomFieldValues;
- $objs->{'find_expired_rows'} = 1;
+ $objs->{'find_disabled_rows'} = 1;
push( @$list, $objs );
# Object attributes
-----------------------------------------------------------------------
More information about the rt-commit
mailing list