--- rat/lonpageflip.pm 2021/08/09 18:51:04 1.109 +++ rat/lonpageflip.pm 2022/10/29 18:13:29 1.114 @@ -2,7 +2,7 @@ # # Page flip handler # -# $Id: lonpageflip.pm,v 1.109 2021/08/09 18:51:04 raeburn Exp $ +# $Id: lonpageflip.pm,v 1.114 2022/10/29 18:13:29 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -126,7 +126,7 @@ sub move { } $deeplinkonly = 0; if ($hash{'deeplinkonly_'.$next}) { - my ($value,$level) = split(/:/,$hash{'deeplinkonly_'.$next}); + my ($value,$level) = map { &unescape($_); } split(/:/,$hash{'deeplinkonly_'.$next}); my ($state,$others,$listed,$scope,$protect) = split(/,/,$value); unless (($state eq 'both') || ($hash{'is_map_'.$next})) { if ($level eq 'resource') { @@ -160,7 +160,7 @@ sub move { } } } elsif (($hash{'deeplinkonly_'.$prev}) && (!$firstres)) { - my ($value,$level) = split(/:/,$hash{'deeplinkonly_'.$prev}); + my ($value,$level) = map { &unescape($_); } split(/:/,$hash{'deeplinkonly_'.$prev}); my ($state,$others,$listed,$scope,$protect) = split(/,/,$value); unless (($state eq 'both') || ($hash{'is_map_'.$prev})) { if ($level eq 'resource') { @@ -502,9 +502,13 @@ sub handler { $r->send_http_header; $r->print(&Apache::loncommon::check_release_result(@reinit)); return OK; - } elsif ($reinitcheck eq 'update') { - my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; - my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; + } + my ($cnum,$cdom); + if ($reinitcheck) { + $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; + $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; + } + if (($reinitcheck eq 'main') || ($reinitcheck eq 'both')) { $preupdatepos = &Apache::lonnet::symbread($currenturl); unless ($direction eq 'return') { if (tie(%hash,'GDBM_File',$env{'request.course.fn'}.'_symb.db', @@ -540,6 +544,16 @@ sub handler { } } } + if (($reinitcheck eq 'both') || ($reinitcheck eq 'supp')) { + my $possdel; + if ($reinitcheck eq 'supp') { + $possdel = 1; + } + my ($supplemental,$refs_updated) = &Apache::loncommon::get_supplemental($cnum,$cdom,'',$possdel); + unless ($refs_updated) { + &Apache::loncommon::set_supp_httprefs($cnum,$cdom,$supplemental); + } + } } if ($direction eq 'firstres') { my $furl=&first_accessible_resource(); @@ -690,7 +704,8 @@ sub handler { my $mapid = $hash{'map_pc_'.&Apache::lonnet::clutter($map)}; my $position_deeplink = $hash{'deeplinkonly_'.$mapid.'.'.$resid}; if ($position_deeplink) { - (my $value,$deeplinklevel) = split(/:/,$position_deeplink); + (my $value,$deeplinklevel) = map { &unescape($_); } + split(/:/,$position_deeplink); } } } @@ -835,8 +850,8 @@ ENDSTART } } } - unless (($env{'course.'.$env{'request.course.id'}.'.type'} eq 'Placement') || - ($env{'request.role.adv'})) { + unless (($env{'course.'.$env{'request.course.id'}.'.type'} eq 'Placement') && + (!$env{'request.role.adv'})) { if ($deeplinklevel) { $r->print( &Apache::lonhtmlcommon::actionbox( 500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.