Author: vitorqc
Description:
When trying to import an ontology using the Ontology import page, right after
choosing the statements to import, a blank page with the message:
"Fatal error: Class 'SMWURITypeHandler' not found in
/wiki_path/SemanticMediaWiki/includes/SMW_Datatype.php on line 105"
is shown, and nothing is imported.
The versions of the softwares used are:
Mediawiki 1.7.1,
SMW 0.5,
Php 5.1.6,
Mysql 5.0.24
Debian OS.
After emailing the smw-user list with this problem, S Page suggested to add a
few lines on the code, as seen in the transcription that follows:
"Here's my guess at what might be happening.
Instead of loading the PHP code for every datatype on every request to
MediaWiki, SMW does lazy-loading of the PHP file implementing each datatype as
needed. So SMW_Datatype.php tells itself (in
announceTypeHandler() calls around line 286) that email,uri, url, and annouri
datatypes are implemented by class SMWURITypeHandler in SMW_DT_URI.php , but
doesn't actually include this file.
Somehow the lazy-loading is broken in your case.
A possible fix is to explicit put
- My temp Workaround for ontology import bug
global $smwgIP;
include_once($smwgIP . '/includes/SMW_DT_URI.php');
towards the top of SMW_Datatype.php, just after
require_once('SMW_DT_Float.php');
to force the code to be loaded.
Good luck,
S"
With that little change the ontology import worked as expected.
Version: unspecified
Severity: major
OS: Linux
Platform: PC