Last modified: 2013-09-05 12:40:02 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T54396, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 52396 - SMW master Fatal error in SMW_refreshData.php
SMW master Fatal error in SMW_refreshData.php
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
master
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-01 13:34 UTC by Jamie Thingelstad
Modified: 2013-09-05 12:40 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Jamie Thingelstad 2013-08-01 13:34:55 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.
Comment 1 Gerrit Notification Bot 2013-08-01 13:53:29 UTC
Change 77126 had a related patch set uploaded by Mwjames:
(Bug 52396) use getSubject()->getDBkey() instead

https://gerrit.wikimedia.org/r/77126
Comment 2 MWJames 2013-08-01 13:58:12 UTC
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()
Comment 3 MWJames 2013-08-01 14:16:36 UTC
> 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.
Comment 4 Gabriel Glachant 2013-09-05 11:32:59 UTC
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.
Comment 5 MWJames 2013-09-05 11:40:54 UTC
Just to double check, the patch did solve the problem?
Comment 6 Gabriel Glachant 2013-09-05 12:02:51 UTC
Yes definitely. Sorry if that wasn't clear.
Comment 7 Gerrit Notification Bot 2013-09-05 12:38:52 UTC
Change 77126 merged by jenkins-bot:
(Bug 52396) use getSubject()->getDBkey() instead

https://gerrit.wikimedia.org/r/77126
Comment 8 MWJames 2013-09-05 12:40:02 UTC
Thanks for your feedback.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links