Page MenuHomePhabricator

Special:QrCode is available (but broken) when $wgUrlShortenerEnableQrCode is false
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:
A broken image appears. Closer inspection reveals that there's undefined instead of SVG code - both in the data URL in the <img> and when downloading the file. Precisely, the data URL is data:image/svg+xml,undefined.

What should have happened instead?:
An image with the code should appear

Software version (skip for WMF-hosted wikis like Wikipedia):
Tested on Commons and Meta with different URLs.

Other information (browser name/version, screenshots, etc.):

image.png (453×1 px, 55 KB)

There's no error nor warning in the browser console. Tested in Edge 121 (Chromium-based)

Event Timeline

Samwilson renamed this task from Special:QrCode returns undefined instead of proper SVG to Special:QrCode is available (but broken) when $wgUrlShortenerEnableQrCode is false.Feb 2 2024, 9:20 AM
Samwilson subscribed.

Thanks for reporting this.

This is because the $wgUrlShortenerEnableQrCode feature flag was still off yesterday, and so the special page would not work. There's nothing actually wrong with generating the QR code image, the bug here is that the special page should've been displayed at all. I've updated the task title to reflect this, and we'll get it fixed soon.

This would be a good task to tackle in the upcoming Wishathon (if it's not resolved before then).

Change 1002937 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/extensions/UrlShortener@master] SpecialQrCode: show error message QR codes are disbaled

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

MusikAnimal subscribed.

Also a good small task for the Wishathon, but with this bug present, we're currently advertsing Extension:UrlShortener as stable but with a broken Special:QrCode page (because $wgUrlShortenerEnableQrCode is false by default).

Change 1002937 merged by jenkins-bot:

[mediawiki/extensions/UrlShortener@master] SpecialQrCode: show error message when QR codes are disabled

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

dom_walden subscribed.

When $wgUrlShortenerEnableQrCode = false;, Special:QrCode does not load, instead showing the below message:

qrcode_false.png (327×607 px, 22 KB)

Special:UrlShortener still works.

Test environment: local docker wiki UrlShortener 1.2.0 (5432bd6) 21:21, 15 February 2024