User:AnomieBOT/source/tasks/TemplateSubster/Base.pm: Difference between revisions

Content deleted Content added
AnomieBOT (talk | contribs)
Updating published sources: TemplateSubster: * Split logic into a "base" class, to share with the new TFDTemplateSubster. TFDTemplateSubster: * New task!
 
AnomieBOT (talk | contribs)
Updating published sources: TFDTemplateSubster: * Improve reporting of "unsupported wikitext" condition.
Line 171:
}
 
# Check whether the edit (or lack thereof) actually removed all transclusions of the template
# Mark that we checked it
my $res2=$api->store->{$key}query( action => ['parse', oldid => $revid, 0x08prop => 'templates', formatversion => 2 ]);
if($res2->{'code'} eq 'success') {
my $flag = ( grep { $_->{'title'} eq $self->{'curtitle'} } @{$res2->{'parse'}{'templates'}} ) ? 0x08 : 0;
$process->{$self->{'curtitle'}} |= $flag;
$api->store->{$key} = [ $revid, $flag ];
} else {
# Err? Just re-check it later.
$api->warn( "Failed to parse $title (rev $revid): " . $res2->{'error'} . "\n" );
$process->{$self->{'curtitle'}} |= 0x4000;
$api->store->{$key} = [ 0, 0 ];
}
 
# If we've been at it long enough, let another task have a go. Set