Skip to content

Commit

Permalink
Item14202: Rename addTopicRef to addDependencyForLink
Browse files Browse the repository at this point in the history
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 fcae5c9 commit a9c8961
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions core/lib/Foswiki/PageCache.pm
Expand Up @@ -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.
Expand All @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions core/lib/Foswiki/Render.pm
Expand Up @@ -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,
Expand All @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion core/lib/Foswiki/Search.pm
Expand Up @@ -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 );
Expand Down

0 comments on commit a9c8961

Please sign in to comment.