Skip to content

Commit 985fd12

Browse files
Merge pull request #11 from Wikia/PLATFORM-10832-using-data-fix-alternative
fix(PLATFORM-10832): [do not merge] alternative fix
2 parents 378c4ad + bf4de5d commit 985fd12

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/UsingDataHooks.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ static function ( Parser $dataParser ) use ( $text, $title, $parser ) {
138138
}
139139

140140
private function makeDataParserAndRun( Parser $parser, callable $callback ): void {
141-
$hookRunnerProperty = new ReflectionProperty( $parser, 'hookRunner' );
141+
$hookRunnerProperty = new ReflectionProperty( Parser::class, 'hookRunner' );
142142
$originalHookRunner = $hookRunnerProperty->getValue( $parser );
143143

144-
$hookContainerProperty = new ReflectionProperty( $originalHookRunner, 'container' );
144+
$hookContainerProperty = new ReflectionProperty( HookRunner::class, 'container' );
145145
$hookContainer = $hookContainerProperty->getValue( $originalHookRunner );
146146

147147
$newHookRunner = new class ( $hookContainer ) extends HookRunner {
@@ -151,6 +151,7 @@ public function onParserClearState( $parser ): bool {
151151
};
152152

153153
try {
154+
$this->isInDataSearchMode = true;
154155
$dataParser = clone $parser;
155156
$hookRunnerProperty->setValue( $dataParser, $newHookRunner );
156157
$callback( $dataParser );

0 commit comments

Comments
 (0)