Skip to content

Commit ca74d69

Browse files
authored
MBS-11793: Don't fetch Wikipedia abstract when URL is ended (metabrainz#2178)
Obviously, if someone has marked a relationship as ended then we shouldn't be using that relationship to display an abstract - either it will not show anything, or it will show the wrong thing.
1 parent cd2da57 commit ca74d69

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/MusicBrainz/Server/Controller/Role/WikipediaExtract.pm

+3-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ sub _get_extract
4242
elsif ($_->target->isa('MusicBrainz::Server::Entity::URL::Wikidata')) { 1; }
4343
else { 0; }
4444
} grep {
45-
$_->target->isa('MusicBrainz::Server::Entity::URL::Wikipedia') ||
46-
$_->target->isa('MusicBrainz::Server::Entity::URL::Wikidata')
45+
!$_->link->{ended} &&
46+
($_->target->isa('MusicBrainz::Server::Entity::URL::Wikipedia') ||
47+
$_->target->isa('MusicBrainz::Server::Entity::URL::Wikidata'))
4748
} @{ $entity->relationships_by_link_type_names('wikipedia', 'wikidata') };
4849

4950
if (scalar @links) {

0 commit comments

Comments
 (0)