Changeset 8253


Ignore:
Timestamp:
07/20/10 08:32:19 (3 years ago)
Author:
CrawfordCurrie
Message:

Item9352: changed the hasAttachment method back to only testing the store for attachment existence. This means that the meta might have a 'handle' to an attachment that doesn't exist in the DB, which has the potential to be very confusing; but I can't fix this without compromising compatibility :-(

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/lib/Foswiki/Meta.pm

    r8250 r8253  
    26052605 
    26062606---++ ObjectMethod hasAttachment( $name ) -> $boolean 
    2607 Test if the named attachment exists. Only valid on topics. 
     2607Test if the named attachment exists. Only valid on topics. The attachment 
     2608must exist in the store (it is not sufficient for it to be referenced 
     2609in the object only) 
    26082610 
    26092611=cut 
     
    26132615    ASSERT( $this->{_web} && $this->{_topic}, 'this is not a topic object' ) 
    26142616      if DEBUG; 
    2615     return 1 if $this->{_session}->{store}->attachmentExists( $this, $name ); 
    2616  
    2617     # Store denies knowledge of it; check the meta, just in case it's 
    2618     # been added to meta but not saved yet 
    2619     $this->reload(0) unless $this->latestIsLoaded(); 
    2620     return defined $this->get( 'FILEATTACHMENT', $name ); 
    2621  
     2617    return $this->{_session}->{store}->attachmentExists( $this, $name ); 
    26222618} 
    26232619 
Note: See TracChangeset for help on using the changeset viewer.