1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00

Import: Fix page_redirects to English namespaces in non-English wikis

This commit is contained in:
gnosygnu
2017-02-20 20:18:39 -05:00
parent b171592d77
commit 94a755124e
3 changed files with 12 additions and 4 deletions

View File

@@ -41,11 +41,15 @@ public abstract class Xob_init_base implements Xob_cmd, Gfo_invk {
}
public void Cmd_end() {
wiki.Appe().Gui_mgr().Html_mgr().Portal_mgr().Wikis().Itms_reset(); // dirty wiki list so that next refresh will load itm
// if (wiki.Appe().Setup_mgr().Dump_mgr().Css_wiki_update()) { // NOTE: used to be option, but was no longer being set; may need to reinstate; DATE:2016-12-21
Io_url url = wiki.Appe().Fsys_mgr().Wiki_css_dir(wiki.Domain_str()).GenSubFil(Xoa_css_extractor.Css_wiki_name);
usr_dlg.Log_many("", "", "deleting css: ~{0}", url.Raw());
Io_mgr.Instance.DeleteFil_args(url).MissingFails_off().Exec();
// }
// always save xowa_cfg import data now; note that other builder commands will load cfg and overwrite data with null; DATE:2017-02-20
gplx.xowa.wikis.data.Xowd_cfg_tbl_.Insert__import(wiki);
}
@gplx.Virtual public void Cmd_term() {}
@gplx.Virtual public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {

View File

@@ -35,7 +35,11 @@ public class Xob_page_cmd extends Xob_itm_basic_base implements Xob_page_wkr, Gf
this.db_mgr = wiki.Db_mgr_as_sql().Core_data_mgr();
this.page_core_tbl = db_mgr.Tbl__page();
this.text_zip_mgr = wiki.Utl__zip_mgr();
text_zip_tid = Xobldr_cfg.Zip_mode__text(app);
this.text_zip_tid = Xobldr_cfg.Zip_mode__text(app);
// NOTE: rebuild needed to add canonical namespaces as templates; else, redirects to English namespaces won't work in non-English wikis; EX: gu.w and #REDIRECT [[Template:COLON]]; DATE:2017-02-20
Xow_ns_mgr_.rebuild_(wiki.Lang(), wiki.Ns_mgr());
this.ns_to_db_mgr = new Xob_ns_to_db_mgr(new Xob_ns_to_db_wkr__text(), db_mgr, Xobldr_cfg.Max_size__text(app));
this.dg_match_mgr = Dg_match_mgr.New_mgr(app, wiki);
if (dg_match_mgr != null) redirect_id_enabled = true; // always enable redirect_id if dg_match_mgr enabled; DATE:2016-01-04