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

Item67: a missing form definition would make a topic uneditable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/lib/TWiki/UI/Save.pm

    r411 r412  
    237237        $formDef = new TWiki::Form( $session, $webName, $formName ); 
    238238        unless ($formDef) { 
    239             throw TWiki::OopsException( 
    240                 'attention', 
    241                 def    => 'no_form_def', 
    242                 web    => $session->{webName}, 
    243                 topic  => $session->{topicName}, 
    244                 params => [ $webName, $formName ] 
    245             ); 
     239            unless ($prevMeta) { 
     240                throw TWiki::OopsException( 
     241                    'attention', 
     242                    def    => 'no_form_def', 
     243                    web    => $session->{webName}, 
     244                    topic  => $session->{topicName}, 
     245                    params => [ $webName, $formName ] 
     246                ); 
     247            } 
     248 
     249            # Recreate the form fields from the previous rev of the topic. 
     250            $formDef = 
     251              new TWiki::Form( $session, $webName, $formName, $prevMeta ); 
    246252        } 
    247253        $newMeta->put( 'FORM', { name => $formName } ); 
Note: See TracChangeset for help on using the changeset viewer.