From ce7ef54a40dfcb8464f623f644c6e33e1fa7cd4a Mon Sep 17 00:00:00 2001 From: lokal-profil Date: Thu, 21 Sep 2023 12:57:01 +0200 Subject: [PATCH] Correct namespace numbers On Wikidata the item and Property namespace numbers are 0 and 120. On WBStack they are 120 and 122. Namespaces in classes/Common.php ignored since this file has not been adapted to WbStack at all --- public_html/resources/js/wikidata.js | 4 ++-- public_html/resources/vue/typeahead-search.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public_html/resources/js/wikidata.js b/public_html/resources/js/wikidata.js index 6f2e8db..b433a5a 100644 --- a/public_html/resources/js/wikidata.js +++ b/public_html/resources/js/wikidata.js @@ -9,8 +9,8 @@ function WikiDataItem ( init_wd , init_raw ) { // Methods this.isPlaceholder = function () { return this.placeholder ; } - this.isItem = function () { return (this.raw||{ns:-1}).ns == 0 ; } - this.isProperty = function () { return (this.raw||{ns:-1}).ns == 120 ; } + this.isItem = function () { return (this.raw||{ns:-1}).ns == 120 ; } + this.isProperty = function () { return (this.raw||{ns:-1}).ns == 122 ; } this.getID = function () { return (this.raw||{}).id ; } this.getURL = function () { diff --git a/public_html/resources/vue/typeahead-search.html b/public_html/resources/vue/typeahead-search.html index d782204..5aec291 100644 --- a/public_html/resources/vue/typeahead-search.html +++ b/public_html/resources/vue/typeahead-search.html @@ -118,7 +118,7 @@ $.getJSON ( 'https://www.wikidata.org/w/api.php?callback=?' , { action:'query', list:'search', - srnamespace:(me.type=='property'?120:0), // TODO lexemes'n'stuff + srnamespace:(me.type=='property'?122:120), // TODO lexemes'n'stuff srlimit:(me.limit||10), srsearch:query, format:'json'