[Rt-commit] rt branch, 4.4/ocfv-disabled-flag, created. rt-4.2.5-210-gd639b5c

? sunnavy sunnavy at bestpractical.com
Sat Oct 25 12:45:46 EDT 2014


The branch, 4.4/ocfv-disabled-flag has been created
        at  d639b5cdfdda452513f40a5a2ae4db17dc708004 (commit)

- Log -----------------------------------------------------------------
commit d639b5cdfdda452513f40a5a2ae4db17dc708004
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/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..483d22a 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' );
+        $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' );
+        $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