https://bugzilla.wikimedia.org/show_bug.cgi?id=31085

       Web browser: ---
             Bug #: 31085
           Summary: SMWQueryProcessor::createQuery() not adjusted to
                    Changes in SMWQueryProcessor::getParameters() in 1.6.2
           Product: MediaWiki extensions
           Version: any
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: Semantic MediaWiki
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified


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.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to