Page MenuHomePhabricator

Edit button broken in new toolbars in embed
Open, Needs TriagePublic

Description

After I run this embedded query and click "Edit" in the new toolbar on the right, nothing happens and the menu seems to be broken (see the screenshot).

Wikidata Query Service.png (661×1 px, 224 KB)

I also get 404 request to https://www.wikidata.org/api/rest_v1/page/html/Wikidata%3ASPARQL_query_service%2Fqueries%2Fexamples%2Fundefined?redirect=false

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

It seems foaf prefix is not defined

wdqs.min.0968a8fe8abab9fafb2d.js:1 Error: Unknown prefix: foaf

Since it's external query, the target server may know what foaf: is. And in any case, even if query syntax doesn't parse, it should not break the GUI.

The 404 may be separate problem, as I am seeing it on other queries too.

The problem is SPARQL.js tries to parse the query and then fails with the error when trying to resolve the prefix.
I am afraid we cannot do anything about it.
A workaround would be defining the prefix in the query or in the default prefixes ...

Can we make it display something sensible instead of broken UI when such an error happens?

Earlier, if this happened then the button would act as "edit with SPARQL editor" and a new tab would open. So should we make it behave like that?