Permalink
Browse files

Item14202: Rename addTopicRef to addDependencyForLink

More accurately depicts what the purpose of the routine is for. Used
"Link" instead of suggested "WikiWord" because this is used for any
internal links, not just WikiWork style linking.
  • Loading branch information...
gac410 committed Oct 31, 2016
1 parent ba74813 commit d39fa8e270e4d58fc5bf56fccdf843955bef1ef5
Showing with 6 additions and 6 deletions.
  1. +3 −3 core/lib/Foswiki/PageCache.pm
  2. +2 −2 core/lib/Foswiki/Render.pm
  3. +1 −1 core/lib/Foswiki/Search.pm
@@ -449,7 +449,7 @@ sub isCacheable {
=begin TML
----++ ObjectMethod addTopicRef($web, $topic)
+---++ ObjectMethod addDependencyForLink($web, $topic)
Add a reference to a web.topic to the dependencies of the current page.
@@ -463,10 +463,10 @@ but if set to authenticated, links are tracked only for logged in users.
=cut
-sub addTopicRef {
+sub addDependencyForLink {
my ( $this, $webRef, $topicRef ) = @_;
- #Foswiki::Func::writeDebug( "addTopicRef $webRef.$topicRef\n" ) if TRACE;
+#Foswiki::Func::writeDebug( "addDependencyForLink $webRef.$topicRef\n" ) if TRACE;
my $session = $Foswiki::Plugins::SESSION;
@@ -1308,7 +1308,7 @@ sub _renderWikiWord {
# add a dependency so that the page gets invalidated as soon as the
# topic is deleted
- $this->{session}->{cache}->addTopicRef( $web, $topic )
+ $this->{session}->{cache}->addDependencyForLink( $web, $topic )
if $Foswiki::cfg{Cache}{Enabled};
return _renderExistingWikiWord( $this, $web, $topic, $linkText, $anchor,
@@ -1324,7 +1324,7 @@ sub _renderWikiWord {
# add a dependency so that the page gets invalidated as soon as the
# WikiWord comes into existance
# Note we *ignore* the params if the target topic does not exist
- $this->{session}->{cache}->addTopicRef( $web, $topic )
+ $this->{session}->{cache}->addDependencyForLink( $web, $topic )
if $Foswiki::cfg{Cache}{Enabled};
return _renderNonExistingWikiWord( $this, $web, $topic, $linkText );
@@ -794,7 +794,7 @@ sub formatResults {
# add dependencies (TODO: unclear if this should be before the paging, or after the allowView - sadly, it can't be _in_ the infoCache)
if ( my $cache = $session->{cache} ) {
- $cache->addTopicRef( $web, $topic );
+ $cache->addDependencyForLink( $web, $topic );
}
my $topicMeta = $this->metacache->getMeta( $web, $topic );

0 comments on commit d39fa8e

Please sign in to comment.