Ignore:
Timestamp:
11/03/08 13:48:54 (4 years ago)
Author:
CrawfordCurrie
Message:

Item67: a missing form definition would make a topic uneditable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Release04x02/lib/TWiki/UI/Save.pm

    r21 r413  
    226226        $formDef = new TWiki::Form( $session, $webName, $formName ); 
    227227        unless ($formDef) { 
    228             throw TWiki::OopsException( 
    229                 'attention', 
    230                 def    => 'no_form_def', 
    231                 web    => $session->{webName}, 
    232                 topic  => $session->{topicName}, 
    233                 params => [ $webName, $formName ] 
    234             ); 
     228            unless ($prevMeta) { 
     229                throw TWiki::OopsException( 
     230                    'attention', 
     231                    def    => 'no_form_def', 
     232                    web    => $session->{webName}, 
     233                    topic  => $session->{topicName}, 
     234                    params => [ $webName, $formName ] 
     235                ); 
     236            } 
     237 
     238            # Recreate the form fields from the previous rev of the topic. 
     239            $formDef = 
     240              new TWiki::Form( $session, $webName, $formName, $prevMeta ); 
    235241        } 
    236242        $newMeta->put( 'FORM', { name => $formName } ); 
Note: See TracChangeset for help on using the changeset viewer.