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

raeburn raeburn at source.lon-capa.org
Mon Dec 30 12:13:26 EST 2024


raeburn		Mon Dec 30 17:13:26 2024 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/publisher	lonpublisher.pm 
  Log:
  - For 2.11
    Backport 1.305, 1.306
  
  
Index: loncom/publisher/lonpublisher.pm
diff -u loncom/publisher/lonpublisher.pm:1.295.2.3 loncom/publisher/lonpublisher.pm:1.295.2.4
--- loncom/publisher/lonpublisher.pm:1.295.2.3	Wed Jul  3 21:21:46 2024
+++ loncom/publisher/lonpublisher.pm	Mon Dec 30 17:13:26 2024
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Publication Handler
 #
-# $Id: lonpublisher.pm,v 1.295.2.3 2024/07/03 21:21:46 raeburn Exp $
+# $Id: lonpublisher.pm,v 1.295.2.4 2024/12/30 17:13:26 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -420,7 +420,7 @@
     }
     my %lt = &Apache::lonlocal::texthash(
                                             'default' => 'System wide - can be used for any courses system wide',
-                                            'domain'  => 'Domain only - use limited to courses in the domai',
+                                            'domain'  => 'Domain only - use limited to courses in the domain',
                                             'custom'  => 'Customized right of use ...',
                                             'public'  => 'Public - no authentication or authorization required for use',
                                             'closed'  => 'Closed - XML source is closed to everyone',
@@ -1972,36 +1972,39 @@
 # =============================================================== Notifications
 sub notify {  
 # --------------------------------------------------- Send update notifications
-    foreach my $targetsource (@{$modified_urls}){
-	my ($target,$source)=@{$targetsource};
-	my $logfile=Apache::File->new('>>'.$source.'.log');
-	print $logfile "\nCleanup phase: Notifications\n";
-	my @subscribed=&get_subscribed_hosts($target);
-	foreach my $subhost (@subscribed) {
-	    print $logfile "\nNotifying host ".$subhost.':';
-	    my $reply=&Apache::lonnet::critical('update:'.$target,$subhost);
-	    print $logfile $reply;
-	}
+    if (ref($modified_urls) eq 'ARRAY') {
+        foreach my $targetsource (@{$modified_urls}){
+	    my ($target,$source)=@{$targetsource};
+	    my $logfile=Apache::File->new('>>'.$source.'.log');
+	    print $logfile "\nCleanup phase: Notifications\n";
+	    my @subscribed=&get_subscribed_hosts($target);
+	    foreach my $subhost (@subscribed) {
+	        print $logfile "\nNotifying host ".$subhost.':';
+	        my $reply=&Apache::lonnet::critical('update:'.$target,$subhost);
+	        print $logfile $reply;
+	    }
 # ---------------------------------------- Send update notifications, meta only
-	my @subscribedmeta=&get_subscribed_hosts("$target.meta");
-	foreach my $subhost (@subscribedmeta) {
-	    print $logfile "\nNotifying host for metadata only ".$subhost.':';
-	    my $reply=&Apache::lonnet::critical('update:'.$target.'.meta',
-						$subhost);
-	    print $logfile $reply;
-	} 
+	    my @subscribedmeta=&get_subscribed_hosts("$target.meta");
+	    foreach my $subhost (@subscribedmeta) {
+	        print $logfile "\nNotifying host for metadata only ".$subhost.':';
+	        my $reply=&Apache::lonnet::critical('update:'.$target.'.meta',
+						    $subhost);
+	        print $logfile $reply;
+	    }
 # --------------------------------------------------- Notify subscribed courses
-	my %courses=&coursedependencies($target);
-	my $now=time;
-	foreach my $course (keys(%courses)) {
-	    print $logfile "\nNotifying course ".$course.':';
-	    my ($cdom,$cname)=split(/\_/,$course);
-	    my $reply=&Apache::lonnet::cput
-		('versionupdate',{$target => $now},$cdom,$cname);
-	    print $logfile $reply;
-	}
-	print $logfile "\n============ Done ============\n";
-	$logfile->close();
+	    my %courses=&coursedependencies($target);
+	    my $now=time;
+	    foreach my $course (keys(%courses)) {
+	        print $logfile "\nNotifying course ".$course.':';
+	        my ($cdom,$cname)=split(/\_/,$course);
+	        my $reply=&Apache::lonnet::cput
+		    ('versionupdate',{$target => $now},$cdom,$cname);
+	        print $logfile $reply;
+	    }
+	    print $logfile "\n============ Done ============\n";
+	    $logfile->close();
+        }
+        $modified_urls = [];
     }
     if ($lock) { &Apache::lonnet::remove_lock($lock); }
     return OK;




More information about the LON-CAPA-cvs mailing list