[LON-CAPA-cvs] cvs: loncom /publisher lonpublisher.pm

www lon-capa-cvs@mail.lon-capa.org
Wed, 31 Dec 2003 03:02:49 -0000


www		Tue Dec 30 22:02:49 2003 EDT

  Modified files:              
    /loncom/publisher	lonpublisher.pm 
  Log:
  Bug #2444: now erases error messages also on republication.
  
  
Index: loncom/publisher/lonpublisher.pm
diff -u loncom/publisher/lonpublisher.pm:1.158 loncom/publisher/lonpublisher.pm:1.159
--- loncom/publisher/lonpublisher.pm:1.158	Mon Dec 29 16:17:00 2003
+++ loncom/publisher/lonpublisher.pm	Tue Dec 30 22:02:49 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Publication Handler
 #
-# $Id: lonpublisher.pm,v 1.158 2003/12/29 21:17:00 www Exp $
+# $Id: lonpublisher.pm,v 1.159 2003/12/31 03:02:49 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -127,6 +127,7 @@
 use Apache::lonlocal;
 use Apache::loncfile;
 use Apache::lonmeta;
+use Apache::lonmsg;
 use vars qw(%metadatafields %metadatakeys);
 
 my %addid;
@@ -1016,6 +1017,9 @@
         }
 
     } else {
+# ------------------------------------------ See if anything new in file itself
+ 
+	$allmeta=&parseformeta($source,$style);
 # ---------------------- Read previous metafile, remember parameters and stores
 
         $scrout.=&metaread($logfile,$source.'.meta');
@@ -1026,9 +1030,6 @@
 		delete $metadatafields{$_};
             }
         }
-# ------------------------------------------ See if anything new in file itself
- 
-	$allmeta=&parseformeta($source,$style);
    }
 
        
@@ -1434,7 +1435,10 @@
 	$r->print($error);
 	print $logfile "\n".$error;
     }
-
+# --------------------------------------------- Delete author resource messages
+    my $delresult=&Apache::lonmsg::del_url_author_res_msg($target); 
+    $r->print('<p>'.&mt('Removing error messages:').' '.$delresult.'</p>');
+    print $logfile "\nRemoving error messages: $delresult";
 # ----------------------------------------------------------- Copy old versions
    
     if (-e $target) {
@@ -1750,7 +1754,7 @@
 # -------------------------------------------------------------- Check filename
 
     my $fn=&Apache::lonnet::unescape($ENV{'form.filename'});
-
+    $fn=~s/\.meta$//;
   
     unless ($fn) { 
 	$r->log_reason($cuname.' at '.$cudom.