Changeset 2831

Show
Ignore:
Timestamp:
07/22/08 23:26:13 (4 months ago)
Author:
arvind
Message:

More bug fixes:
* $orig is not available on a post_save callback for new objects
* Show a proper error message if we don't get two objects to diff
* Fixed pack_revision using a fully serialized object

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/feature-revision-histories/lib/MT/Revisable.pm

    r2830 r2831  
    161161     
    162162    foreach my $col (@$revisioned_cols) { 
    163         next if $obj->$col eq $orig->$col; 
    164         next if exists $date_cols{$col}  
     163        next if $orig && $obj->$col eq $orig->$col; 
     164        next if $orig && exists $date_cols{$col}  
    165165                        && $orig->$col eq MT::Object::_db2ts($obj->$col); 
    166166         
     
    175175    my $obj = shift; 
    176176    my $values; 
    177     my $cols = $obj->column_values; 
     177    my $values = $obj->column_values; 
    178178 
    179179    my $meta_values = $obj->meta; 
     
    308308    my $obj_a = $revisions[0]->[0]; 
    309309    my $obj_b = $revisions[1]->[0]; 
    310     my %diff; 
    311      
     310     
     311    return $obj->error(MT->translate("Did not get two [_1]", lc $obj->class_label_plural)) 
     312        if ref $obj_a ne 'MT::Entry' || ref $obj_b ne 'MT::Entry'; 
     313     
     314    my %diff;     
    312315    my $cols = $obj->revisioned_columns(); 
    313316    foreach my $col (@$cols) {