--- loncom/xml/lonxml.pm 2005/06/29 19:02:14 1.379
+++ loncom/xml/lonxml.pm 2005/07/08 10:39:49 1.380
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# XML Parser Module
#
-# $Id: lonxml.pm,v 1.379 2005/06/29 19:02:14 albertel Exp $
+# $Id: lonxml.pm,v 1.380 2005/07/08 10:39:49 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -818,7 +818,7 @@ sub startredirection {
sub endredirection {
if (!$Apache::lonxml::redirection) {
- &Apache::lonxml::error("Endredirection was called, before a startredirection, perhaps you have unbalanced tags. Some debuging information:".join ":",caller);
+ &Apache::lonxml::error("Endredirection was called before a startredirection, perhaps you have unbalanced tags. Some debugging information:".join ":",caller);
return '';
}
$Apache::lonxml::redirection--;
@@ -1432,14 +1432,26 @@ sub error {
&Apache::lonmsg::author_res_msg($env{'request.filename'},join('
',@_));
#notify course
if ( $symb && $env{'request.course.id'} ) {
+ my $cnum=$env{'course.'.$env{'request.course.id'}.'.num'};
+ my $cdom=$env{'course.'.$env{'request.course.id'}.'.domain'};
my (undef,%users)=&Apache::lonfeedback::decide_receiver(undef,0,1,1,1);
my $declutter=&Apache::lonnet::declutter($env{'request.filename'});
my @userlist;
foreach (keys %users) {
my ($user,$domain) = split(/:/, $_);
push(@userlist,"$user\@$domain");
- &Apache::lonmsg::user_normal_msg($user,$domain,
+ my $key=$declutter.'_'.$user.'_'.$domain;
+ my %lastnotified=&Apache::lonnet::get('nohist_xmlerrornotifications',
+ [$key],
+ $cdom,$cnum);
+ my $now=time;
+ if ($now-$lastnotified{$key}>86400) {
+ &Apache::lonmsg::user_normal_msg($user,$domain,
"Error [$declutter]",join('
',@_));
+ &Apache::lonnet::put('nohist_xmlerrornotifications',
+ {$key => $now},
+ $cdom,$cnum);
+ }
}
if ($env{'request.role.adv'}) {
$errormsg=&mt("An error occured while processing this resource. The course personnel ([_1]) and the author have been notified.",join(', ',@userlist));