[LON-CAPA-cvs] cvs: loncom /interface londocs.pm /lonnet/perl lonnet.pm
www
lon-capa-cvs@mail.lon-capa.org
Thu, 20 Jul 2006 01:18:46 -0000
www Wed Jul 19 21:18:46 2006 EDT
Modified files:
/loncom/interface londocs.pm
/loncom/lonnet/perl lonnet.pm
Log:
Bug #4763: devalidate title cache after renaming resource
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.237 loncom/interface/londocs.pm:1.238
--- loncom/interface/londocs.pm:1.237 Fri Jun 30 16:33:49 2006
+++ loncom/interface/londocs.pm Wed Jul 19 21:18:26 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.237 2006/06/30 20:33:49 albertel Exp $
+# $Id: londocs.pm,v 1.238 2006/07/20 01:18:26 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1163,6 +1163,8 @@
$Apache::lonratedt::order[$idx]]=
$comment.':'.join(':',@rrest);
}
+# Devalidate title cache
+ &Apache::lonnet::devalidate_title_cache(&Apache::lonnet::unescape($rrest[0]));
}
# Store the changed version
($errtext,$fatal)=&storemap($coursenum,$coursedom,
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.762 loncom/lonnet/perl/lonnet.pm:1.763
--- loncom/lonnet/perl/lonnet.pm:1.762 Wed Jul 19 15:44:52 2006
+++ loncom/lonnet/perl/lonnet.pm Wed Jul 19 21:18:46 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network
# TCP networking package
#
-# $Id: lonnet.pm,v 1.762 2006/07/19 19:44:52 raeburn Exp $
+# $Id: lonnet.pm,v 1.763 2006/07/20 01:18:46 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -5155,6 +5155,17 @@
&devalidate_cache_new('courseres',$hashid);
}
+# ------------------------------------------------------ Devalidate title cache
+
+sub devalidate_title_cache {
+ my ($url)=@_;
+ if (!$env{'request.course.id'}) { return; }
+ my $symb=&symbread($url);
+ if (!$symb) { return; }
+ my $key=$env{'request.course.id'}."\0".$symb;
+ &devalidate_cache_new('title',$key);
+}
+
# --------------------------------------------------- Course Resourcedata Query
sub get_courseresdata {