--- loncom/interface/londocs.pm 2022/10/19 02:10:20 1.683 +++ loncom/interface/londocs.pm 2022/10/22 17:24:54 1.684 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.683 2022/10/19 02:10:20 raeburn Exp $ +# $Id: londocs.pm,v 1.684 2022/10/22 17:24:54 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -5931,6 +5931,7 @@ sub handler { my %codebase = (); my ($upload_result,$upload_output,$uploadphase); if ($canedit) { + undef($suppchanges); if (($env{'form.uploaddoc.filename'}) && ($env{'form.cmd'}=~/^upload_(\w+)/)) { my $context = $1; @@ -5942,6 +5943,10 @@ sub handler { if ($hadchanges) { &mark_hash_old(); } + if ($suppchanges) { + &Apache::lonnet::update_supp_caches($coursedom,$coursenum); + undef($suppchanges); + } $r->print($upload_output); } elsif ($env{'form.phase'} eq 'upload_embedded') { # Process file upload - phase two - upload embedded objects @@ -6903,25 +6908,7 @@ my %suporderhash = ( $r->print('

'.$error.'

'); } if ($suppchanges) { - my %servers = &Apache::lonnet::internet_dom_servers($coursedom); - my @ids=&Apache::lonnet::current_machine_ids(); - foreach my $server (keys(%servers)) { - next if (grep(/^\Q$server\E$/,@ids)); - my $hashid=$coursenum.':'.$coursedom; - my $cachekey = &escape('showsupp').':'.&escape($hashid); - &Apache::lonnet::remote_devalidate_cache($server,[$cachekey]); - } - &Apache::lonnet::has_unhidden_suppfiles($coursenum,$coursedom,1); - &Apache::lonnet::count_supptools($coursenum,$coursedom,1); - my $now = time; - if ($env{'request.course.id'} eq $coursedom.'_'.$coursenum) { - &Apache::lonnet::appenv({'request.course.suppupdated' => $now}); - } - &Apache::lonnet::put('environment',{'internal.supplementalchange' => $now}, - $coursedom,$coursenum); - &Apache::lonnet::appenv( - {'course.'.$coursedom.'_'.$coursenum.'.internal.supplementalchange' => $now}); - &Apache::lonnet::do_cache_new('suppchange',$coursedom.'_'.$coursenum,$now,600); + &Apache::lonnet::update_supp_caches($coursedom,$coursenum); undef($suppchanges); } } @@ -7092,6 +7079,10 @@ sub remove_archive { if ($url eq $env{'form.archiveurl'}) { if (&handle_edit_cmd($docuname,$docudom)) { ($errtext,$fatal) = &storemap($docuname,$docudom,$map,1); + if ($suppchanges) { + &Apache::lonnet::update_supp_caches($docudom,$docuname); + undef($suppchanges); + } if ($fatal) { if ($container eq 'page') { $delwarning = &mt('An error occurred updating the contents of the current page.');