Page MenuHomePhabricator

PHP Fatal error: Call to a member function getFulltext() on null in GraphViz_body.php on line 500
Closed, DeclinedPublic

Description

Setup

  • MediaWiki 1.27.3 (1f4cb6e) 18:05, 10. Nov. 2017
  • PHP 5.6.30-0+deb8u1 (apache2handler)
  • Semantic MediaWiki 2.5.5 (5aa7f20) 15:16, 25. Okt. 2017
  • Semantic Result Formats 2.5.3 (f89f87f) 16:08, 25. Okt. 2017
  • ImageMap – (43aaced) 16:20, 20. Okt. 2017
  • Graphviz 2.1.0 (61bbbc6) 17:22, 2. Aug. 2017

Issue

PHP Fatal error:  Call to a member function getFulltext() on null in /../w/extensions/GraphViz/GraphViz_body.php on line 500, referer: https://www.example.org/wiki/Test

This happens on a disclosed wiki when trying to edit (&action=edit) a page what is containing a graph which was rendered using the "graph" format of the "Semantic Results Formats" extension.

The query looks like this:

{{#ask:
 [[Process::Test]]
 |?Has successor=
 |format=graph
 |nodeshape=rectangle
 |graphlink=yes
 |graphlabel=yes
 |arrowdirection=TB
}}

@Welterkj Will this information be sufficient to tackle the issue or should I try to replicate the issue on a publicly accessible wiki?

Event Timeline

I've not been able to reproduce this locally (but I haven't tried everything yet). I wonder what situations lead to the title of a Parser object not being set?

SemanticResultFormats seems to be calling GraphViz with:

$result = GraphViz::graphvizParserHook( $graphInput, "", $GLOBALS['wgParser'], "" );

I'm not sure if switching to something like

global $wgParser;
$wgParser->recursiveTagParse( "<graphviz>$graphInput</graphviz>" );

would make any difference, because I guess the Title still isn't set there? (That's how SRF_Calendar does it.)

So it sort of feels like this bug might be in SemanticResultFormats, but I also think GraphViz should be more usable than it currently is for other extensions. :-)

@Samwilson Thanks a lot for having a peep at this. Applying the proposed change apparently makes things even worse. Now even action "submit" fails. I guess I will have to try and replicate this on a publicly accessible wiki.

So I failed to replicate, too. However the public wiki is on 1.29.2 and does not use BlueSpice stuff so there may be some unwanted interaction. So it may be just a thing of adding some safe guard in the code.

@mwjames getting you in the loop in case it is a result format "graph" issue. I will create an issue at GitHub if this is the case.

@Samwilson So more reports of this issue role in SMW GitHub issue 2848. The error log however gives me a MediaWiki core related issue at the same time which I will report and reference to this task.

See here for this example

The error log however gives me a MediaWiki core related issue at the same time which I will report and reference to this task.

Nope, this was unrelated and not an issue at all. So back to "Call to a member function getFulltext() on null"

In the meantime the publicly accessible test wiki was upgraded to:

  • MediaWiki 1.30.0-rc.0 (25caa3a) 05:31, 30 November 2017
  • PHP 5.6.30-0+deb8u1 (apache2handler)
  • MariaDB 10.0.33-MariaDB-1~jessie
  • GraphViz 3.0.0 (8630e3f) 22:31, 2 December 2017

So the error case constructed for T180376#3797070 is no longer happening. So at least on MW 1.29+ this issue seems to be resolved. I will come back to this in about 18 months to confirm that is also working on the wiki from which the issue was observed first.

Well the reason for this error no longer happening is that GraphViz is no longer working at all in connection with SMW and SRF. So I preliminarily created T181926 for this.

In the meantime the publicly accessible test wiki was upgraded to:

  • MediaWiki 1.30.0 (d0c8f49) 19:49, 5. Jan. 2018
  • PHP 5.6.30-0+deb8u1 (apache2handler)
  • MariaDB 10.0.33-MariaDB-1~jessie
  • GraphViz 3.0.0 (d74210e) 01:55, 30. Dez. 2017
  • Semantic MediaWiki 3.0.0-alpha (c6a27a3) 10:19, 4. Jan. 2018
  • Semantic Result Formats 3.0.0-alpha (0482d48) 10:19, 4. Jan. 2018

Now we are getting:

Fatal error: Call to a member function isTalkPage() on null in /../w/extensions/DisplayTitle/includes/DisplayTitleHooks.php on line 183

After disabling DisplayTitle:

Fatal error: Call to a member function getIsSectionPreview() on null in /../w/extensions/Translate/tag/PageTranslationHooks.php on line 47

After disabling Translate:

Fatal error: Call to a member function getMaxIncludeSize() on null in /../w/includes/parser/Parser.php on line 2907

Example page: https://sandbox.semantic-mediawiki.org/wiki/Issue/Graphviz

Is this issue still happening? I'm not able to reproduce it still.

Yes I still get an error though I am not sure if it is still the same as originally reported.

  • MediaWiki 1.31.1 (a013eed) 10:46, 31. Okt. 2018
  • PHP 7.0.30-0+deb9u1 (apache2handler)
  • MariaDB 10.1.26-MariaDB-0+deb9u1
  • Semantic MediaWiki 3.1.0-alpha (176c516) 08:46, 12. Nov. 2018
  • Semantic Result Formats 3.1.0-alpha (dfe68d2) 08:46, 12. Nov. 2018
  • GraphViz 3.0.0 (258df48) 01:40, 6. Nov. 2018
  • DisplayTitle 2.0.0 (8a726b3) 17:09, 6. Dez. 2017

[84be57f6148a54d50d3ad915] /w/index.php?title=Sp%C3%A9cial%3ARequ%C3%AAter&q=%5B%5BArticleAuthor%3A%3A%2B%5D%5D&po=%3FArticleAuthor%0D%0A&eq=yes&p%5Bformat%5D=graph&p%5Bsource%5D=&p%5Blimit%5D=200&p%5Boffset%5D=0&p%5Blink%5D=all&p%5Bheaders%5D=show&p%5Bmainlabel%5D=&p%5Bintro%5D=&p%5Boutro%5D=&p%5Bsearchlabel%5D=...+further+results&p%5Bdefault%5D=&p%5Bgraphname%5D=QueryResult&p%5Bgraphsize%5D=&p%5Barrowdirection%5D=LR&p%5Bnodeshape%5D=&p%5Brelation%5D=child&p%5Bnameproperty%5D=&p%5Bwordwraplimit%5D=25&sort_num%5B%5D=&order_num%5B%5D=asc&sort_num%5B%5D=&order_num%5B%5D=asc&eq=yes Error from line 183 of /../w/extensions/DisplayTitle/includes/DisplayTitleHooks.php: Call to a member function isTalkPage() on null

Backtrace:

#0 /../w/includes/Hooks.php(177): DisplayTitleHooks::onParserBeforeStrip(Parser, string, NULL)
#1 /../w/includes/Hooks.php(205): Hooks::callHook(string, array, array, NULL)
#2 /../w/includes/parser/Parser.php(649): Hooks::run(string, array)
#3 /../w/extensions/SemanticResultFormats/formats/graphviz/SRF_Graph.php(136): Parser->recursiveTagParse(string)
#4 /../w/extensions/SemanticMediaWiki/src/Query/ResultPrinters/ResultPrinter.php(342): SRFGraph->getResultText(SMWQueryResult, integer)
#5 /../w/extensions/SemanticMediaWiki/src/Query/ResultPrinters/ResultPrinter.php(307): SMW\Query\ResultPrinters\ResultPrinter->buildResult(SMWQueryResult)
#6 /../w/extensions/SemanticMediaWiki/src/MediaWiki/Specials/SpecialAsk.php(457): SMW\Query\ResultPrinters\ResultPrinter->getResult(SMWQueryResult, array, integer)
#7 /../w/extensions/SemanticMediaWiki/src/MediaWiki/Specials/SpecialAsk.php(310): SMW\MediaWiki\Specials\SpecialAsk->fetchResults(SRFGraph, SMWQuery, SMW\MediaWiki\Specials\Ask\UrlArgs)
#8 /../w/extensions/SemanticMediaWiki/src/MediaWiki/Specials/SpecialAsk.php(169): SMW\MediaWiki\Specials\SpecialAsk->makeHTMLResult()
#9 /../w/includes/specialpage/SpecialPage.php(522): SMW\MediaWiki\Specials\SpecialAsk->execute(NULL)
#10 /../w/includes/specialpage/SpecialPageFactory.php(568): SpecialPage->run(NULL)
#11 /../w/includes/MediaWiki.php(288): SpecialPageFactory::executePath(Title, RequestContext)
#12 /../w/includes/MediaWiki.php(861): MediaWiki->performRequest()
#13 /../w/includes/MediaWiki.php(524): MediaWiki->main()
#14 /../w/index.php(42): MediaWiki->run()
#15 {main}

I get a similar error as the original post related to SRF Array:

Fatal error: 
Call to a member function createArray() on null in .../SemanticResultFormats/formats/array/SRF_Array.php on line 211

Setup:

  • MediaWiki 1.27.5
  • PHP 5.6.25 (apache2handler)
  • MariaDB 5.5.60-MariaDB
  • ICU 50.1.2
  • BlueSpice 2.27.3
  • Semantic Drilldown 2.0.2
  • Semantic Internal Objects 0.8.0 (021b137) 17:29, 22 April 2014
  • Semantic MediaWiki 2.5.6
  • Semantic Result Formats 1.8

@Nakohdo I think you are indeed piggy-backing on a similar but unrelated issue. You fix has to be done in SRF but the versions you are using are outdated for quite some time. I suggest trying to give recent versions a shot and see if you are still getting your issue. If yes, please report on GitHub for SRF.

@Kghbln Thanks for the quick reply and the pointer.