Page MenuHomePhabricator

Badly defined surveys cause issues
Closed, ResolvedPublic

Description

(When fixing please add a test)
Notice: Undefined index: description in /Users/jrobson/git/core/extensions/QuickSurveys/includes/QuickSurveys.hooks.php on line 57

Define:

$wgQuickSurveysConfig = array(
	array(
		"@name"=> "survey name",
		"name"=> "internal example survey",
		"@type"=> "internal or external link survey",
		"type"=> "internal",
		"@question"=> "survey question message key",
		"question"=> "ext-quicksurveys-example-internal-survey-question",
		"@answers"=> "possible answer message keys for positive, neutral, and negative",
		"answers"=> array(
			"positive"=> "ext-quicksurveys-example-internal-survey-answer-positive",
			"neutral"=> "ext-quicksurveys-example-internal-survey-answer-neutral",
			"negative"=> "ext-quicksurveys-example-internal-survey-answer-negative"
		),
		"@schema"=> "Which schema to log to",
		"schema"=> "QuickSurveysResponse",
		"@enabled"=> "whether the survey is enabled",
		"enabled"=> true,
		"@coverage"=> "percentage of users that will see the survey",
		"coverage"=> "100",
		"@platform"=> "for each platform (desktop, mobile), which version of it is targeted (stable, beta, alpha)",
		"platform"=> array(
			"desktop"=> ["stable"],
			"mobile"=> ["stable", "beta", "alpha"]
		)
	),

and notice an error when you load the page at http://localhost:8888/w/index.php/Headings?quicksurvey=true

Event Timeline

Jdlrobson raised the priority of this task from to Needs Triage.
Jdlrobson updated the task description. (Show Details)
Jdlrobson subscribed.

Change 234267 had a related patch set uploaded (by Phuedx):
Model internal and external surveys

https://gerrit.wikimedia.org/r/234267

(When fixing please add a browser test)

Won't a PHP unit test suffice?

fyi jenkins was playing up and fixed by https://gerrit.wikimedia.org/r/234414
Still not sure what the root cause was though. An issue with that job.

Change 234267 merged by jenkins-bot:
Model internal and external surveys

https://gerrit.wikimedia.org/r/234267