Thread:Extension talk:Semantic Extra Special Properties/Problems with v0.2.3

Exception
Sometimes I have an exception in PHP code:

$firstRevision = $title->getFirstRevision; $firstAuthor  = User::newFromId( $firstRevision->getRawUser  );

I added debug statements and found a cause: Some artificial pages does not have first revision, so $firstRevision is null, and calling getRawUser method on null gets the code into trouble.

I fond the reason: Some fake pages does not have any revisions. Fake pages appears when an extension like SemanticMaps play tricks with parser to get template expanded or something like this.

Adding additional check

if ( $firstRevision !== null )

helps to avoid the problem.

One way ticket?
When I have discovered the crash, my first desire was to disable extension. However, after disabling I had another trouble: I cannot view properties any more: There is no predefined property with "___CUSER".

Backtrace:


 * 1) 0 /var/www/oc.su/Extensions/SemanticMediaWiki-1.7.1/includes/storage/SMW_SqlStubSemanticData.php(182): SMWDIProperty->__construct('___CUSER', false)
 * 2) 1 /var/www/oc.su/Extensions/SemanticMediaWiki-1.7.1/includes/storage/SMW_SqlStubSemanticData.php(164): SMWSqlStubSemanticData->unstubProperty('___CUSER')
 * 3) 2 /var/www/oc.su/Extensions/SemanticMediaWiki-1.7.1/includes/storage/SMW_SqlStubSemanticData.php(69): SMWSqlStubSemanticData->unstubProperties
 * 4) 3 /var/www/oc.su/Extensions/SemanticMediaWiki-1.7.1/specials/SearchTriple/SMW_SpecialBrowse.php(155): SMWSqlStubSemanticData->getProperties
 * 5) 4 /var/www/oc.su/Extensions/SemanticMediaWiki-1.7.1/specials/SearchTriple/SMW_SpecialBrowse.php(108): SMWSpecialBrowse->displayData(Object(SMWSqlStubSemanticData), true)
 * 6) 5 /var/www/oc.su/Extensions/SemanticMediaWiki-1.7.1/specials/SearchTriple/SMW_SpecialBrowse.php(86): SMWSpecialBrowse->displayBrowse
 * 7) 6 /var/www/oc.su/MediaWiki-1.18.1/includes/SpecialPageFactory.php(458): SMWSpecialBrowse->execute('???????????????...')
 * 8) 7 /var/www/oc.su/MediaWiki-1.18.1/includes/Wiki.php(240): SpecialPageFactory::executePath(Object(Title), Object(RequestContext))
 * 9) 8 /var/www/oc.su/MediaWiki-1.18.1/includes/Wiki.php(640): MediaWiki->performRequest
 * 10) 9 /var/www/oc.su/MediaWiki-1.18.1/includes/Wiki.php(547): MediaWiki->main
 * 11) 10 /var/www/oc.su/MediaWiki-1.18.1/index.php(57): MediaWiki->run
 * 12) 11 {main}

Of course, I have database backed up before installing new extension, so I can just restore entire database. But someone may decide to stop using extra properties after long usage. How to stop using it?