Problems uploading and deleting files

From semantic-mediawiki.org

Hello,

i have enable file upload with $wgEnableUploads=true; in the LocalSettingsp.php, but i am having some problems.

Each time i try to download a file, i will get a screen which says:

Fatal error: Call to a member function mapDataItemToElement() on a non-object in /home/u480878357/public_html/mediawiki/extensions/SemanticMediaWiki/includes/export/SMW_Exporter.php on line 594

That line stands for this peace of code:

static public function getDataItemExpElement( SMWDataItem $dataItem ) { return self::$dataItemToElementEncoder->mapDataItemToElement( $dataItem ); }


Anyway, even if i get that error, file gets uploaded to the repository.

Afterwards, when i go to repository and i try to delete that file i get:

Fatal error: Call to a member function mapDataItemToElement() on a non-object in /home/u480878357/public_html/mediawiki/extensions/SemanticMediaWiki/includes/export/SMW_Exporter.php on line 594

Exactly the same error, but this time the file will not be deleted.


What is causing this and how could i solve it?

Atm i am installing the semantic media wiki on a free host (hostinger), which uses linux's Centos 5.5 distribution i believe, do not know if that has an influence.

13:52, 27 May 2015

> Fatal error: Call to a member function mapDataItemToElement() on a non-object in /home/u480878357/public_html/mediawiki/extensions/SemanticMediaWiki/includes/export/SMW_Exporter.php on line 594

This error can virtually not happen because each call in SMW is using `Exporter::getInstance()->getDataItemExpElement` and there should be not one single caller that is executing `Exporter::getDataItemExpElement` directly therefore I cannot tell as to what happens on your installation. Furthermore, the upload is tested against SQLStore and SPARQLStore with a real upload process [0].

Having the complete stack trace would help in guessing where `Exporter::getDataItemExpElement` is called from.

[0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/tests/phpunit/Integration/MediaWiki/Hooks/FileUploadIntegrationTest.php

14:29, 27 May 2015

Ok, problem was definitively coming from:

http://www.mediawiki.org/wiki/Extension:RDFIO

which was calling that function. Going to try to solve it by making a clean instalation of it again (to see if i made an error, even if i know pretty much for sure that it sometimes randomly fails, from previous local instalations) and if that does not the thing, i will go for the complete stack trace.

Many thanks.

14:45, 27 May 2015

> Ok, problem was definitively coming from:

http://www.mediawiki.org/wiki/Extension:RDFIO

The `Exporter` should always be called using `Exporter::getInstance()->...`.

14:50, 27 May 2015