When you visit https://en.wikipedia.beta.wmflabs.org/wiki/Book you'll see an external survey like in the screenshot below. The privacy link is rendered as text rather than a link. And the "Visit survey" button is treating the link as a relative link: https://en.wikipedia.beta.wmflabs.org/wiki/[https://docs.google.com/forms/d/e/1FAIpQLSdEkmzsJphxoAJohZWoll80AT4Q-ExJvia_-lT9bKOL-uofOw/viewform?hl=en%5D&entry.1791119923=690c0d77a2aae7af299a
{F28296035}
The previous survey which ran between 01/07 and 01/09/2019 didn't have these problems. A regression seems to have been introduced since then.
This is blocking our deployment of the survey, please make it a high priority.
= Developer notes
QuickSurveys is using the ResourceLoaderGetConfigVars hook to ship a config variable that looks like this:
```
[{"name":"Reader-trust-survey-en-v1","question":"Reader-trust-1-message","description":"Reader-trust-1-description","module":"ext.quicksurveys.survey.Reader-trust-survey-en-v1","coverage":1,"platforms":{"desktop":["stable"],"mobile":["stable"]},"privacyPolicy":"Reader-trust-1-privacy","type":"external","link":"Reader-trust-1-link","instanceTokenParameterName":"token","isInsecure":false},{"name":"reader-demographics-en-pilot","question":"Reader-demographics-1-message","description":"Reader-demographics-1-description","module":"ext.quicksurveys.survey.reader-demographics-en-pilot","coverage":1,"platforms":{"desktop":["stable"],"mobile":["stable"]},"privacyPolicy":"Reader-demographics-1-privacy","type":"external","link":"Reader-demographics-1-link","instanceTokenParameterName":"entry.1791119923","isInsecure":false}]
```
The messages are shipped via a ResourceLoader module created via [[ https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderRegisterModules | ResourceLoaderRegisterModules ]] via a ResourceLoaderModule:
```
/**
* ResourceLoaderRegisterModules hook handler
*
* Registers needed modules for enabled surveys
*
* @see https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderRegisterModules
*
* @param ResourceLoader &$resourceLoader The ResourceLoader object
* @return bool Always true
*/
public static function onResourceLoaderRegisterModules( ResourceLoader &$resourceLoader ) {
$enabledSurveys = self::getEnabledSurveys();
foreach ( $enabledSurveys as $survey ) {
$moduleName = $survey->getResourceLoaderModuleName();
$module = [
$moduleName => [
'messages' => $survey->getMessages(),
'targets' => [ 'desktop', 'mobile' ],
],
];
$resourceLoader->register( $module );
}
return true;
}
```
In this particular case a module 'ext.quicksurveys.survey.Reader-trust-survey-en-v1' contained an outdated message that had since been updated.
After a few days/clearing localStorage the message updated.
I'm not sure if this indicates a problem in ResourceLoader, or is just something to watch out for when enabling new surveys.