Content deleted Content added
Updating published sources: PERTableUpdater: * Handle requests for create-protected pages. |
Updating published sources: PERTableUpdater: * Handle multiple requests (on different talk pages) pointing to the same target page. * As a side effect, that fixes the problem where the request link is wrong if the request gets archived. |
||
Line 79:
$api->store->{"SPER pages"}=$api->store->{"pages1"};
delete $api->store->{"pages1"};
}
if(($api->store->{"ver"}//1) < 2){
for my $tag (qw/PER TPER SPER EDITREQ/) {
next unless exists($api->store->{"$tag pages"});
my %new = ();
while(my ($k,$v) = each %old) {
$new{$k}{$v->{'talk'}} = $v;
}
$api->store->{"$tag pages"} = \%new;
}
$api->store->{"ver"} = 2;
}
Line 191 ⟶ 203:
}
for my $t (@pages) {
my $
title => $t,
talk => $p->{'title'},
touched => ISO2timestamp($p->{'touched'}),
});
delete $pages{$t}{$tt}{'color'};
delete $pages{$t}{$tt}{'prottype'};
delete $pages{$t}{$tt}{'reason'};
delete $pages{$t}{$tt}{'logtitle'};
}
}
Line 217 ⟶ 229:
}
my $t=$p->{'title'};
▲ my $pd=$pages{$t};
my ($k,$pd) = each %{$pages{$t}}; # Get first
# Protection scoring "bitmap":
Line 332 ⟶ 345:
}
$pd->{'logtitle'}=$pg;
# now fill in the rest
my @keys = qw/prottype reason color logtitle/;
while(my ($k, $pd2) = each %{$pages{$t}}) {
@{$pd2}{@keys} = @{$pd}{@keys};
}
}
}
# The formatting here is a little strange, for backwards compat
my @pages=map { values %$_ } values %pages;
my $txt=qq(<div class="veblenbot-pertable">\n);
$txt.=qq({| class="wikitable" style="padding:0em"\n);
$txt.=qq(|-\n);
my $ct=scalar
my $s=($ct==1?'':'s');
my $pg='User:AnomieBOT/'.$tag.'Table';
Line 350 ⟶ 370:
$txt.=qq(! Protection level\n);
$txt.=qq(! class = "unsortable" | Last protection log entry\n);
for my $p (sort { $a->{'touched'} <=> $b->{'touched'} }
my $c=$colors{$p->{'color'}};
my $t=$p->{'title'};
|