Skip to content

Commit

Permalink
TPCInclude: Always re-evaluate any page, independently of its mapping.
Browse files Browse the repository at this point in the history
The original reason to even do this in the first place unfortunately
seems to be lost to time…
  • Loading branch information
nmlgc committed Mar 25, 2019
1 parent 64dd7c2 commit 55a54be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
6 changes: 1 addition & 5 deletions TPCPatchMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ public static function get( $title ) {
);
}

/**
* @return bool true if mapping was updated
*/
public static function update( $title, $patch, $game = null, $target = null ) {
$map = self::get( $title );
$patches = self::mergePatch( $map, $patch );
Expand All @@ -96,10 +93,9 @@ public static function update( $title, $patch, $game = null, $target = null ) {
( TPCUtil::dictGet( $map->pm_game ) === $game ) and
( TPCUtil::dictGet( $map->pm_target ) === $target )
) {
return false;
return;
}
self::updateMapping( $title, $patches, $game, $target );
return true;
}

/**
Expand Down
6 changes: 2 additions & 4 deletions hooks/TPCInclude.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,12 @@ public static function onTarget( &$tpcState, $title, &$temp, $patch = null ) {
$file = TPCUtil::dictGet( $temp->params['target'] );
}

$titleID = $title->getArticleID();

if ( !$patch ) {
$patch = $tpcState->patches[0];
}

$parse = TPCPatchMap::update( $title, $patch, $game, $file );
if ( $parse and $titleID ) {
TPCPatchMap::update( $title, $patch, $game, $file );
if ( $title->getArticleID() ) {
TouhouPatchCenter::evalTitle( $title );
}
return true;
Expand Down

0 comments on commit 55a54be

Please sign in to comment.