Page MenuHomePhabricator

rvparse doesn’t seem to work with rvsection
Closed, ResolvedPublic

Description

With some articles, rvparse and rvsection don’t seem to work together, e.g. http://en.wikipedia.org/w/api.php?action=query&prop=revisions&titles=Iron%20Maiden&rvprop=content&rvsection=0&rvparse&format=yamlfm. All page content is returned. Without rvparse it works but that’s not what is desired. Workaround is action=parse, but that could be too limited.


Version: unspecified
Severity: major

Details

Reference
bz28897

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 11:26 PM
bzimport set Reference to bz28897.

Looks as if the option was programmed to only apply to the content returned, not when the content is parsed. I agree that's confusing and should probably be changed.

			if ( $this->parseContent ) {
				$articleObj = new Article( $title );

				$p_result = $articleObj->getParserOutput();
				$text = $p_result->getText();
			}

That overrides the section text already pulled in

			if ( $this->section !== false ) {
				$text = $wgParser->getSection( $text, $this->section, false );
				if ( $text === false ) {
					$this->dieUsage( "There is no section {$this->section} in r" . $revision->getId(), 'nosuchsection' );
				}
			}

I think this has never actually worked since introduction in r75266