Page MenuHomePhabricator

Unexpected dangling whitespace in module value when calling action=query&list=gadgets on ace.wp
Open, Needs TriagePublic

Description

Go to https://ace.wikipedia.org/w/api.php?action=query&list=gadgets&gaprop=id|metadata|desc

Output for scripts has an unexpected dangling/trailing whitespace for script filename in "MediaWiki:Gadget-HotCat.js ":

{
    "id": "HotCat",
    "metadata": {
        "settings": {
            "rights": [],
            "skins": [],
            "actions": [],
            "category": "editing-gadgets"
        },
        "module": {
            "scripts": [
                "MediaWiki:Gadget-HotCat.js "
            ],
            "styles": [],
            "datas": [],
            "dependencies": [],
            "peers": [],
            "messages": []
        }
    },
    "desc": "Menambahkan, menghapus, dan mengubah kategori dengan saran (<a href=\"https://en.wikipedia.org/wiki/User:TheDJ/HotCat\" class=\"extiw\" title=\"en:User:TheDJ/HotCat\">HotCat</a>)"
},

Event Timeline

Aklapper renamed this task from Unexpected dangling whitespace in script name when calling action=query&list=gadgets on ace.wp to Unexpected dangling whitespace in module value when calling action=query&list=gadgets on ace.wp.Jul 20 2022, 9:27 AM
Ciencia_Al_Poder added a subscriber: Ciencia_Al_Poder.

There's an space at the end of HotCat.js in MediaWiki:Gadgets-definition

That looks like something that should handle the Gadgets extension

Thanks for finding the reason! I had no idea that list=gadgets pulls from MediaWiki:Gadgets-definition.

DannyS712 claimed this task.
DannyS712 added a subscriber: DannyS712.

Fixed with an onwiki edit in my capacity as a global sysop (grants interface admin rights as well), https://ace.wikipedia.org/wiki/Special:Diff/137538

SD0001 removed DannyS712 as the assignee of this task.
SD0001 added a subscriber: SD0001.

Ideally, either the gadget repo or API code in Gadgets extension should strip trailing whitespaces.