Page MenuHomePhabricator

SMWSparqlStore datatype error
Closed, ResolvedPublic

Description

Author: gcarnevale

Description:
MediaWiki: 1.22
SemanticMediaWiki: 1.9.1
$smwgDefaultStore = 'SMWSparqlStore';

Error when creating new category:

Unexpected non-MediaWiki exception encountered, of type "InvalidArgumentException"
[acddfe5f] /mediawiki/index.php/Speciale:ModificaDati/Lifecycle_Step/aszss Exception from line 253 of mediawiki/extensions/SemanticMediaWiki/includes/export/SMW_Exp_Element.php: $datatype needs to be a string
Backtrace:
#0 mediawiki/extensions/SemanticMediaWiki/includes/sparql/SMW_SparqlResultParser.php(143): SMWExpLiteral->__construct(string, boolean)
#1 [internal function]: SMWSparqlResultParser->xmlHandleCData(resource, string)
#2 mediawiki/extensions/SemanticMediaWiki/includes/sparql/SMW_SparqlResultParser.php(79): xml_parse(resource, string, integer)
....
....
....


Version: REL1_22-branch
Severity: normal
OS: Linux

Details

Reference
bz62218

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:57 AM
bzimport set Reference to bz62218.
bzimport added a subscriber: Unknown Object (MLST).

gcarnevale wrote:

Proposed fix:

In the file extensions/SemanticMediaWiki/includes/sparql/SMW_SparqlResultParser.php (line 115, method xmlHandleOpen) the property m_xml_datatype is set to false when the xml datatype attribute is not present in attributes array; but the SMWExpLiteral __construct (extensions/SemanticMediaWiki/includes/export/SMW_Exp_Element.php file) throw new InvalidArgumentException (line 253) if the datatype param is not a string.

We fixed this replacing at line 115 of the extensions/SemanticMediaWiki/includes/sparql/SMW_SparqlResultParser.php file:

$this->m_xml_datatype = false;

with

$this->m_xml_datatype = '';

Change 116760 had a related patch set uploaded by Carnevalegiacomo:
Possible fix to bug 62218 https://bugzilla.wikimedia.org/show_bug.cgi?id=62218

https://gerrit.wikimedia.org/r/116760

Change 116760 had a related patch set uploaded by Nemo bis:
Possible fix to bug 62218

https://gerrit.wikimedia.org/r/116760

Unknown Object (User) added a comment.Jul 23 2014, 2:17 PM

*** Bug 54714 has been marked as a duplicate of this bug. ***