Last modified: 2014-09-18 18:08:48 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 T47176, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 45176 - Semantic properties do not show up on factbox
Semantic properties do not show up on factbox
Status: RESOLVED WORKSFORME
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
REL1_20-branch
All All
: Unprioritized major (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-19 23:01 UTC by Hans Meiser
Modified: 2014-09-18 18:08 UTC (History)
4 users (show)

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


Attachments

Description Hans Meiser 2013-02-19 23:01:06 UTC
SMW 1.8.x

Hello,


semantic properties do not show up on factbox if programatically generated via PHP.

Someone allready commented this with the advice to invalidate the cache without explaining how.

I guess I do this and it seems to be a real bug not a cache problem.

Here comes the code...every tip/hint/fix is very welcome!

[...]
SMWDIProperty::registerProperty( '___EXIFSOFTWARE', '_str','MyNewProp'); SMWDIProperty::registerPropertyAlias( '___EXIFSOFTWARE', 'MyNewProp' ) [...]

 public function UpdateDataBefore($store, $data ){
        global $wgUser,$wgEnableParserCache,$wgParser;
        $wgParser->disableCache();
        $wgEnableParserCache = false;
   
        $str = "EinTestString";  
        $property = new SMWDIProperty( '___EXIFSOFTWARE' );
        $dataItem = new SMWDIString( $str );
        $data->addPropertyObjectValue($property, $dataItem);

[...]

PS: 

1. The Properties show up on Special:Browse but not on the factbox!
Also the PHP-generated properties are automatically declared as special properties...I don't know why. Could someone explain?

2. If someone could provide some code snipped too, to demonstrate how to manipulate -->$data<-- on the fly in an UpdateDataBefore-handler this would be very very nice and open some doors to new innovations. This doc here is not enough:
http://semantic-mediawiki.org/wiki/SMW_Hooks/SMWStore::updateDataBefore
Comment 1 MWJames 2014-09-18 18:08:48 UTC
Using the [0] hook will enable you to show extra content but using `SMWStore::updateDataBefore` is the incorrect use for having additional data shown in the Factbox.

[0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/includes/src/Factbox/Factbox.php#L249

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


Navigation
Links