Last modified: 2013-09-05 12:40:02 UTC
I'm running near-master on 5b0dc1a745c143d77a590f4e72f2f588e07b5255 and with the most recent changes this fatal error is showing when running SMW_refreshData.php via cron. PHP Fatal error: Call to a member function getDBkey() on a non-object in /srv/www/mediawiki/public_html/w/extensions/SemanticMediaWiki/includes/BasePropertyAnnotator.php on line 121 I'm guessing this is related to bug #52293. This was working fine before the most recent changes.
Change 77126 had a related patch set uploaded by Mwjames: (Bug 52396) use getSubject()->getDBkey() instead https://gerrit.wikimedia.org/r/77126
Could you try to run SMW_refreshData with the above change. I'm not really sure why [1] did fail. The test did not cover a non available getTitle()->getDBkey() that's why their is no check and inevitably the error "on member function getDBkey()". If possible could you post the whole stack trace. [1] $this->semanticData->getSubject()->getTitle()->getDBkey()
> I'm guessing this is related to bug #52293. This was working fine before the > most recent changes. No its not related because the former was an issue when accessing addSpecialProperties() but the reported line number points to addDefaultSort(). I really like to see the stake trace because the case above should not happen and the question is why did it happen and what triggered it because the only place where addDefaultSort is called is SMWHooks::onParserAfterTidy which hasn't been changed lately.
Hi, I was getting this same error while following the tutorials on http://www.mediawiki.org/wiki/Extension:Semantic_Forms/Quick_start_guide, on the 'Create forms' step using the Special:CreateForm page. 2013/09/05 11:35:44 [error] 1146#0: *426 FastCGI sent in stderr: "PHP message: PHP Fatal error: Call to a member function getDBkey() on a non-object in /srv/www/<redacted>/htdocs/w/extensions/SemanticMediaWiki/includes/BasePropertyAnnotator.php on line 108" while reading response header from upstream, client: <redacted>, server: <redacted>, request: "POST /wiki/Special:CreateForm HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "<redacted>", referrer: "http://<redacted>/wiki/Special:CreateForm" The following patch *does indeed* solve the issue. --- diff --git a/includes/BasePropertyAnnotator.php b/includes/BasePropertyAnnotator.php index dc9289f..4734ca9 100644 --- a/includes/BasePropertyAnnotator.php +++ b/includes/BasePropertyAnnotator.php @@ -105,7 +105,7 @@ class BasePropertyAnnotator extends ObservableSubject { * @return BasePropertyAnnotator */ public function addDefaultSort( $defaultSort ) { - $sortkey = $defaultSort ? $defaultSort : str_replace( '_', ' ', $this->semanticData->getSubject()->getTitle()->getDBkey() ); + $sortkey = $defaultSort ? $defaultSort : str_replace( '_', ' ', $this->semanticData->getSubject()->getDBkey() ); $this->semanticData->addPropertyObjectValue( new DIProperty( DIProperty::TYPE_SORTKEY ), new SMWDIBlob( $sortkey ) --- I am running MediaWiki from git branch REL1_21 and latest extensions also out of git. Tell me if you need any further information. Regards.
Just to double check, the patch did solve the problem?
Yes definitely. Sorry if that wasn't clear.
Change 77126 merged by jenkins-bot: (Bug 52396) use getSubject()->getDBkey() instead https://gerrit.wikimedia.org/r/77126
Thanks for your feedback.