1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2024-10-27 20:34:16 +00:00

Html: If MediaWiki:Sidebar does not exist, use language's message 'sidebar', not null

This commit is contained in:
gnosygnu 2017-01-05 09:17:21 -05:00
parent 2dc6d8c20b
commit fed89cd89b
2 changed files with 7 additions and 2 deletions

View File

@ -42,8 +42,9 @@ public class Xoh_sidebar_mgr {
byte[] rv = rv_msg.Val();
if (rv_msg.Defined_in() == Xol_msg_itm.Defined_in__wiki && Bry_.Len_gt_0(rv)) return rv;
// sidebar is either (a) in lang.gfs (wikia; wmf wikis without MediaWiki:Sidebar), or (b) not even in lang.gfs (wmf wikis in lang.gfs without "lang.gfs"; EX:de.gfs)
return null;
// sidebar is either (a) in lang.gfs (wikia; wmf wikis without MediaWiki:Sidebar), or (b) not in lang.gfs (wmf wikis in lang.gfs without "lang.gfs"; EX:abcde.gfs)
// if wikia, return null; else return rv; note that all "official" langs (EX: sw) fallback to en.gfs which has a sidebar; DATE:2017-01-05
return wiki.Domain_tid() == Xow_domain_tid_.Tid__other ? null : rv;
}
public void Make(Bry_bfr tmp_bfr, byte[] src) { // TEST:
Xoh_sidebar_parser.Parse(tmp_bfr, wiki, grps, src);

View File

@ -61,12 +61,16 @@ public class Xow_page_mgr implements Gfo_invk {
break;
}
Xoa_ttl redirect_ttl = Load_from_db(rv, ns, ttl, url.Qargs_mgr().Match(Xoa_url_.Qarg__redirect, Xoa_url_.Qarg__redirect__no));
// GOTO_BY_LOOP: handle redirect to special
if (redirect_ttl != null && redirect_ttl.Ns().Id_is_special()) {
ttl = redirect_ttl;
url = wiki.Utl__url_parser().Parse(ttl.Raw()); // update url w/ redirected ttl; need to update qargs else will redirect to correct ttl (Special:XowaCfg) but not qargs (grp=xowa.addon.math); EX:src=Options/Math; trg=Special:XowaCfg?grp=xowa.addon.math; DATE:2017-01-02
rv.Redirect_trail().Clear();
rv.Db().Page().Exists_y_();
}
// not a redirect to special; just exit
else
return;
}
}
public Xoa_ttl Load_from_db(Xoae_page rv, Xow_ns ns, Xoa_ttl ttl, boolean redirect_force) {