Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[datatables] Special:Ask: Error when using intro or outro parameter #853

Open
YvarRavy opened this issue Oct 17, 2024 · 1 comment
Open

Comments

@YvarRavy
Copy link
Contributor

YvarRavy commented Oct 17, 2024

Setup

  • MW version: 1.39
  • DB (MySQL etc.): i don't think that matters here
  • PHP version: 7.4
  • SMW version: 4.1.3
  • SRF version: 4.2.1

Issue

When trying to add either an intro or outro text and search for the results with format datatables you get a big error, when you are using the special:Ask page

Steps to reproduce (recommendation is to use the sandbox)
the sandbox gives a different error because of the Extension:PageInCat
but the way to reproduce the error on any other wiki with SMW & SRF

1. Create ask query doesn't really mattter what i just use [[Category:+]]
2. Use Format=Datatables
3. under Parameters fill in either the intro or outro input field
5. fetch results

Expected result:
the normal results with the outro and intro added to the front and back
Observed result:
Fatal error
Stacktrace

[c127aab4f08c39dcf86f038c] /index.php?title=Speciaal:Vragen& Error: Call to a member function getMaxIncludeSize() on null

Backtrace:

from mediawiki/includes/parser/Parser.php(2937)
#0 mediawiki/includes/parser/Parser.php(1609): Parser->replaceVariables(string)
#1 mediawiki/includes/parser/Parser.php(881): Parser->internalParse(string, boolean, boolean)
#2 mediawiki/includes/parser/Parser.php(905): Parser->recursiveTagParse(string, boolean)
#3 composer-ext/SemanticResultFormats/formats/datatables/DataTables.php(483): Parser->recursiveTagParseFully(string)
#4 composer-ext/SemanticResultFormats/formats/datatables/DataTables.php(445): SRF\DataTables->handleNonFileResult(string, SMW\Query\QueryResult, integer)
#5 composer-ext/SemanticMediaWiki/src/Query/ResultPrinters/ResultPrinter.php(304): SRF\DataTables->buildResult(SMW\Query\QueryResult)
#6 composer-ext/SemanticMediaWiki/src/MediaWiki/Specials/SpecialAsk.php(500): SMW\Query\ResultPrinters\ResultPrinter->getResult(SMW\Query\QueryResult, array, integer)
#7 composer-ext/SemanticMediaWiki/src/MediaWiki/Specials/SpecialAsk.php(314): SMW\MediaWiki\Specials\SpecialAsk->fetchResults(SRF\DataTables, SMWQuery, SMW\Utils\UrlArgs)
#8 composer-ext/SemanticMediaWiki/src/MediaWiki/Specials/SpecialAsk.php(168): SMW\MediaWiki\Specials\SpecialAsk->makeHTMLResult()
#9 mediawiki/includes/specialpage/SpecialPage.php(701): SMW\MediaWiki\Specials\SpecialAsk->execute(NULL)
#10 mediawiki/includes/specialpage/SpecialPageFactory.php(1428): SpecialPage->run(NULL)
#11 mediawiki/includes/MediaWiki.php(316): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, RequestContext)
#12 mediawiki/includes/MediaWiki.php(904): MediaWiki->performRequest()
#13 mediawiki/includes/MediaWiki.php(562): MediaWiki->main()
#14 mediawiki/index.php(50): MediaWiki->run()
#15 mediawiki/index.php(46): wfIndexMain()
#16 mediawiki/wikiroot/index.php(7): require(string)
#17 {main}

@jaideraf jaideraf changed the title Error when using intro or outro parameter [datatables] Error when using intro or outro parameter Oct 17, 2024
@thomas-topway-it
Copy link
Contributor

@YvarRavy thanks for reporting this.
Could you please specify that it is caused by using the Special:Ask page to perform the query ?

$this->mOptions is empty in MW Parser when $this->parser->recursiveTagParseFully is called from the function handleNonFileResult (when Datatables is called from a special page) therefore or the Parser options have to be explicitly set or the original solution pointed out by you here #854

			if ( $outputmode == SMW_OUTPUT_HTML && $this->isHTML ) {
				$result = Message::get( [ 'smw-parse', $this->mIntro ], Message::PARSE ) . $result;
			} elseif ( $outputmode !== SMW_OUTPUT_RAW ) {
				$result = $this->mIntro . $result;
			}

(SMW\Query\ResultPrinters\ResultPrinter)
can be used instead.

@YvarRavy YvarRavy changed the title [datatables] Error when using intro or outro parameter [datatables] Special:Ask: Error when using intro or outro parameter Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants