Last modified: 2010-08-29 20:35:28 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 T25781, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 23781 - PHP Error in SMWQueryProcessor::processFunctionParams
PHP Error in SMWQueryProcessor::processFunctionParams
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
PC All
: Normal normal (vote)
: ---
Assigned To: Markus Krötzsch
http://wiki.montcopa.org/TestWiki/ind...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-06-03 20:48 UTC by Jack D. Pond
Modified: 2010-08-29 20:35 UTC (History)
1 user (show)

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


Attachments

Description Jack D. Pond 2010-06-03 20:48:51 UTC
I haven't examined the developer's wiki code to see if it is invalid, but regardless, SMW shouldn't allow the generation of a PHP error (or 3 in this case).

[03-Jun-2010 16:34:06] PHP Notice:  Undefined variable: printmode in extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php on line 230
[03-Jun-2010 16:34:06] PHP Notice:  Undefined variable: label in extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php on line 230
[03-Jun-2010 16:34:06] PHP Notice:  Undefined variable: data in extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php on line 230


The error occurs on line 230 when the variables $printmode, $label, $data are not defined.

Program execution meets condition commented as: print property or check category

On line 230 SMWQueryProcessor::processFunctionParams::
	printmode defined:false
	label defined:false
	data  defined:false

Parameters passed were:

SMWQueryProcessor::processFunctionParams::rawparams: array(18) {
  [0]=>
  string(28) "[[Category:Assessment Form]]"
  [1]=>
  string(7) "?ASM:ID"
  [2]=>
  string(21) "?Client Date of Birth"
  [3]=>
  string(7) "?Gender"
  [4]=>
  string(5) "?Race"
  [5]=>
  string(9) "?Referred"
  [6]=>
  string(8) "?Charges"
  [7]=>
  string(8) "?in Jail"
  [8]=>
  string(6) "?AxisI"
  [9]=>
  string(7) "?AxisII"
  [10]=>
  string(8) "?AxisIII"
  [11]=>
  string(7) "?AxisIV"
  [12]=>
  string(6) "?AxisV"
  [13]=>
  string(9) "link=none"
  [14]=>
  string(15) "format=template"
  [15]=>
  string(20) "template=MHUserRow12"
  [16]=>
  string(5) "sort="
  [17]=>
  string(9) "limit=100"
}

SMWQueryProcessor::processFunctionParams::querystring: string(28) "[[Category:Assessment Form]]"

SMWQueryProcessor::processFunctionParams::params: array(0) {
}

SMWQueryProcessor::processFunctionParams::printouts: array(0) {
}

SMWQueryProcessor::processFunctionParams::showmode: bool(false)

SMWQueryProcessor::processFunctionParams::propparts: array(2) {
  [0]=>
  string(6) "ASM:ID"
  [1]=>
  bool(false)
}

MontCoBackTrace::(273)extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php::processFunctionParams args: 5
MontCoBackTrace::(216)extensions/SemanticMediaWiki/includes/SMW_ParserExtensions.php::getResultFromFunctionParams args: 2
MontCoBackTrace::(doAsk args: 19
MontCoBackTrace::(2920)includes/parser/Parser.php::call_user_func_array args: 2
MontCoBackTrace::(962)includes/parser/Preprocessor_DOM.php::braceSubstitution args: 2
MontCoBackTrace::(2728)includes/parser/Parser.php::expand args: 2
MontCoBackTrace::(930)includes/parser/Parser.php::replaceVariables args: 1
MontCoBackTrace::(330)includes/parser/Parser.php::internalParse args: 1
MontCoBackTrace::(4020)includes/Article.php::parse args: 6
MontCoBackTrace::(4002)includes/Article.php::getOutputFromWikitext args: 3
MontCoBackTrace::(1345)includes/Article.php::outputWikiText args: 3
MontCoBackTrace::(doViewParse args: 0
MontCoBackTrace::(59)includes/PoolCounter.php::call_user_func args: 1
MontCoBackTrace::(900)includes/Article.php::executeProtected args: 2
MontCoBackTrace::(493)includes/Wiki.php::view args: 0
MontCoBackTrace::(70)includes/Wiki.php::performAction args: 5
MontCoBackTrace::(117)index.php::performRequestForTitle args: 5
Comment 1 Jeroen De Dauw 2010-06-04 20:12:22 UTC
I fixed the not being defined of the $data var, but am not quite sure how the other 2 should be fixed. Maybe there should be an else condition like indicated there might be in the comment?
Comment 2 Markus Krötzsch 2010-08-29 20:35:28 UTC
I have now changed the code to interpret every printout that is not recognized as a Category as belonging to a property. I hope that this fixes the issue. (The change will soon be released in SMW 1.5.2).

My guess is that ASM is a registered namespace prefix in the above example. Writing ?Property:ASM:ID in the query could be a quick fix for the issue.

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


Navigation
Links