mirror of
https://github.com/gnosygnu/xowa.git
synced 2025-05-30 14:04:56 +00:00
Scribunto: Ignore snak if novalue [#481]
This commit is contained in:
parent
3d9491e2de
commit
491d1905c9
@ -173,6 +173,14 @@ public class Basic__tst {
|
||||
Keyval[] args = Wbase_snak_utl_.Get_snak(wdata_fxt, wdata_fxt.Make_claim_monolingual(3, "en", "abc_en"));
|
||||
fxt.Test__proc__kvps__flat(lib, Scrib_lib_wikibase.Invk_renderSnak, args, "abc_en");
|
||||
}
|
||||
@Test public void RenderSnak__no_value() {
|
||||
Keyval[] args = Wbase_snak_utl_.Get_snak(wdata_fxt, new Wbase_claim_string(3, Wbase_claim_value_type_.Tid__novalue, null));
|
||||
fxt.Test__proc__kvps__flat(lib, Scrib_lib_wikibase.Invk_renderSnak, args, "");
|
||||
}
|
||||
@Test public void RenderSnak__data_value_is_null() {
|
||||
Keyval[] args = Wbase_snak_utl_.Get_snak(wdata_fxt, new Wbase_claim_string(3, Wbase_claim_value_type_.Tid__somevalue, null));
|
||||
fxt.Test__proc__kvps__flat(lib, Scrib_lib_wikibase.Invk_renderSnak, args, "");
|
||||
}
|
||||
@Test public void GetEntityUrl() {
|
||||
fxt.Test_scrib_proc_str(lib, Scrib_lib_wikibase.Invk_getEntityUrl, Object_.Ary("Q2" ), "https://www.wikidata.org/wiki/Special:EntityPage/Q2");
|
||||
}
|
||||
|
@ -61,6 +61,12 @@ public class Wdata_prop_val_visitor_ {
|
||||
}
|
||||
}
|
||||
|
||||
if (snak_tid == Wbase_claim_value_type_.Tid__novalue) return; // ISSUE#:481; DATE:2019-06-02
|
||||
if (datavalue_ary == null) {
|
||||
Gfo_usr_dlg_.Instance.Warn_many("", "", "datavalue is empty even though not novalue; page_url=~{0} pid=~{1}", page_url, pid);
|
||||
return;
|
||||
}
|
||||
|
||||
// loop datavalue_ary to get (a) tid,; (b) val_obj
|
||||
byte tid = Byte_.Max_value_127;
|
||||
Object val_obj = null;
|
||||
|
Loading…
Reference in New Issue
Block a user