Page MenuHomePhabricator

Queries with no conditions should not return all pages
Closed, InvalidPublic

Description

When something goes wrong, such as the current behavior where "Category:+" should act as a wild card but instead acts as a nonexistent category (https://bugzilla.wikimedia.org/show_bug.cgi?id=29900), the query returns all pages in the wiki, which is not only unuseful, but also likely to be confusing and more of a problem than simply displaying nothing when nothing is found. Instead, nothing should be returned if there is nothing that matches the query.

See also:

https://bugzilla.wikimedia.org/show_bug.cgi?id=29891#c2

...the reason that [[Category:+]] does not work is simply that it is
ambiguous with SMW's way of searching for pages in the category called "+".
Since this is not a valid page, the query ends up having no conditions and all
pages are returned.


Version: unspecified
Severity: normal

Details

Reference
bz29901
TitleReferenceAuthorSource BranchDest Branch
Correct the location of the plugin directoryrepos/data-engineering/matomo/plugin-marketingcampaignsreporting!1btullisfix_locationdebian
Customize query in GitLab

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 21 2014, 11:30 PM
bzimport set Reference to bz29901.

SMW drops invalid conditions. If you only have one condition, and it's invalid, indeed everything will be shown. Whenever there is at least one invalid condition, an error icon will be displayed underneath the query listing the invalid conditions.

As far as I'm concerned, this is perfectly reasonable behavior, so I'm tempted to mark this as invalid.

It's reasonable when there's more than one condition, but if there's only one, showing everything is a mess. I suppose it would have to be handled as a special case.

It's especially confusing for someone that doesn't know why it's giving incorrect results, and damages credibility for a site that may be giving information this way.

My imagination could come up with instances where the consequences could be particularly damaging either to the user of the data or the site supplying the data. How about if SMW were adopted to dispense pharmaceutical information? Giving incorrect results by default becomes clearly a bad choice in any situation where getting wrong data could kill people, cost somebody money, provoke legal consequences, and so forth.

Marking this as invalid is not recommended.

SMW has a setting to configure this behaviour. The default is to ignore query errors and execute the query anyway (even if empty). You can change this by setting $smwgIgnoreQueryErrors = false; in LocalSetting.php. With this setting, only the error message will be shown when an error occurred in processing the query.