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 7c45a41 commit 13d6306c25fcb0c899212867bcb24bf57d9e4eee
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
@@ -451,7 +451,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.
@@ -465,10 +465,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 13d6306

Please sign in to comment.