On Dienstag, 26. August 2008, Markus Krötzsch wrote:
> On Montag, 25. August 2008, Daniel Friesen wrote:
> > Over at Wikia we've been getting issues with SMW. Sometimes on
> > undeletion a blank page (ie: php fatal error) is given making it
> > impossible to undelete a page.
> SMW 1.3 (release date Sept 7) will fix this (and clean this particular
> piece of code); a pity that it affected someone just before that :-(. I
> will create a bugfix release SMW 1.2.2 and update SVN as well. Give me some
> hours for that.
Okay, done. I could not reprodcue the problem you describe, but it is clear
enough how it should be fixed (I hope I did that in SMW 1.2.2!). I added
further similar checks in other places, since I realise that assuming the
Factbox to be initialised is never safe when you are a hook.
Please let me know if this works for you.
P.S. I sticked to "=== NULL" since I do not like working with isset much. NULL
at least is some value -- it reminds me of proper programming languages ;-).
P.P.S. We should consider refactoring that whole semdata/SMWFactbox
architecture, also to address the problems I started discussing earlier
(subparsers killing SMW data). The current code gets more and more cluttered
with checks that are needed just to make sure that nothing unexpectedly reset
our title or deleted our data. And I fear there are yet more checks one would
need to make it failsafe in all cases.
> -- Markus
> P.S. Any Wikia-related troubles can be sent directly to Denny and me to
> ensure the speedy fixes.
> > Aug 25 04:04:31 10.8.2.55 httpd: PHP Fatal error: Call to a
> > member function getSubject() on a non-object in
> > /usr/wikia/source/releases_200808.3/extensions/3rdparty/SemanticMediaWiki
> >/i ncludes/SMW_Factbox.php on line 326
> > This appears to be the |$this_ns =
> > SMWFactbox::$semdata->getSubject()->getNamespace(); call inside of
> > |SMWFactbox::addImportedDefinition.
> > This would be caused because SMWFactbox::$semdata is not checked to see
> > if it's set before making that call.
> > Could someone else handle this one? Unfortunately I don't know what that
> > function should output if there is a failure in getting the namespace.
> > Also, there may be an issue with the whole namespace stuff.
> > FWIW, last page I had issues undeleting was a user talkpage. Annotations
> > should actually be off. Perhaps actual annotating is disabled, but for
> > some reason the factbox is being called, and causing an error because no
> > annotating was done and thus no title is set for it to use.
> > Oh, btw... I kinda find (SMWFactbox::$semdata === NULL) to be quite
> > ugly. !isset(SMWFactbox::$semdata) works fine, and it's more
> > understandable when you read it.
Semantic MediaWiki http://semantic-mediawiki.org