Content deleted Content added
Updating published sources: EnDashRedirectCreator: * Don't create redirects that would be eligible for WP:CSD#R2. |
Updating published sources: EnDashRedirectCreator: * Skip creating redirects for File talk when the target File page doesn't actually exist (i.e. local talk page for a file on Commons). No point to it. |
||
Line 195:
$api->log("$redir to $target is the talk page of what would be a cross-namespace redirect, skipping");
next;
}
if ( $targetNs == 7 ) {
# Special rule for File talk: If the corresponding file doesn't exist, forget it.
my $n = $target;
$n =~ s/^[^:]*/File/;
my $res = $api->query( titles => $n );
if($res->{'code'} eq 'shutoff'){
$api->warn("Task disabled: ".$res->{'content'}."\n");
return 300;
}
if($res->{'code'} ne 'success'){
$api->warn("Failed to get status for $n: ".$res->{'error'}."\n");
next;
}
if ( exists( (values %{$res->{'query'}{'pages'}} )[0]{'missing'} ) ) {
$api->log("File page redirect [[$redir]] -> [[$target]] has no corresponding target file page, skipping");
next;
}
warn Dumper($res);
}
|