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).

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 project: Wikidata. · View Herald TranscriptAug 14 2018, 6:11 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Jonas moved this task from Backlog to Bugs on the Wikidata Query UI board.Aug 15 2018, 10:27 AM

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?

Lydia_Pintscher added a subscriber: Lydia_Pintscher.

Yes that sounds good to me.