Last modified: 2011-09-22 09:50:34 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 T33085, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 31085 - SMWQueryProcessor::createQuery() not adjusted to Changes in SMWQueryProcessor::getParameters() in 1.6.2
SMWQueryProcessor::createQuery() not adjusted to Changes in SMWQueryProcessor...
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-22 02:51 UTC by Daniel A. R. Werner
Modified: 2011-09-22 09:50 UTC (History)
2 users (show)

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


Attachments

Description Daniel A. R. Werner 2011-09-22 02:51:31 UTC
There have been some changes in Query parameters handling in SMW 1.6.2, the Validators Parameter class is used to define basic SMW parameters in SMWQueryProcessor::getParameters() now.
Parameter::setDefault() allows to set a default value for a parameter in case it was not user-defined in the query. Before the generated array with supplied params didn't contain a item for unset parameters, now it contains an array value with the default.
SMWQueryProcessor::createQuery() still handles the array with the delivered parameter values as if the default were unset array items, but in fact, they are set to the default.
So, in several places in SMWQueryProcessor::createQuery() array_key_exists() is still used to check whether the param was set by the user, while in most cases where the default is set to 'false' for example, "$params['param'] !== false" could be used.

I have not searched for actual buggy behavior resulting from this, but there certainly is some needless/confusing code here.
Comment 1 Jeroen De Dauw 2011-09-22 09:50:34 UTC
I'm aware of this, and it will eventually go. Right now there is still a lot of such old code around, in some places for compat reasons.

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


Navigation
Links