Page MenuHomePhabricator

ArticleAssessmentPilot: parameter validation
Closed, ResolvedPublic

Description

Author: matthew.britton

Description:
ArticleAssessmentPilot hasn't been properly launched, but the API is live and functioning, so I tested it.

http://en.wikipedia.org/w/api.php?action=query&list=articleassessment&aapageid=19161823

As the above link shows, [[User:Gurch]] now scores 9999 out of 5 for sourcing. Validating the ratings might be wise.


Version: unspecified
Severity: minor
URL: http://en.wikipedia.org/w/api.php?action=query&list=articleassessment&aapageid=19161823

Details

Reference
bz25290

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:16 PM
bzimport set Reference to bz25290.
bzimport added a subscriber: Unknown Object (MLST).

It has, it's been live since mid this week. See https://blog.wikimedia.org/blog/2010/09/22/article-feedback-pilot-goes-live/ and it's inclusion category http://en.wikipedia.org/wiki/Category:Article_Feedback_Pilot

The API isn't really designed for end user interaction...

Also

		foreach( $wgArticleAssessmentRatings as $rating ) {
			$ret["r{$rating}"] = array(
				ApiBase::PARAM_TYPE => 'integer',
				ApiBase::PARAM_DFLT => 0,
				ApiBase::PARAM_MIN => 0,
				ApiBase::PARAM_MAX => 5,
			);
		}

The module is offloading the parameter validation to the core API, so it would seem it's a core API bug.. At a guess, it's due to there being no MAX2

CC'ing Roan.

Scrap the MAX2 coment, that's only the case for 'limit' type.

r73742

As per the CR, "Maybe we should have a PARAM_MAX_ENFORCE. Rather than just warning!"