From c3d524c49336913fb06aef58a4eefab9aafff196 Mon Sep 17 00:00:00 2001 From: gnosygnu Date: Sat, 7 Mar 2020 23:46:21 -0500 Subject: [PATCH] Wikibase: Reset pageEntityId on each new page [#638] --- .../engines/LuaCommon/lualib/mw.wikibase.lua | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/res/bin/any/xowa/xtns/Scribunto/engines/LuaCommon/lualib/mw.wikibase.lua b/res/bin/any/xowa/xtns/Scribunto/engines/LuaCommon/lualib/mw.wikibase.lua index 4d367729d..8d280d6d5 100644 --- a/res/bin/any/xowa/xtns/Scribunto/engines/LuaCommon/lualib/mw.wikibase.lua +++ b/res/bin/any/xowa/xtns/Scribunto/engines/LuaCommon/lualib/mw.wikibase.lua @@ -71,13 +71,16 @@ local entityCache = initCache( 15 ) -- 50 slot cache for statements local statementCache = initCache( 50 ) +-- xowa:bgn +-- NOTE: moved from inside wikibase.setupInterface; ISSUE#:638; DATE:2020-03-07 +-- Caching variable for the entity id string belonging to the current page (nil if page is not linked to an entity) +local pageEntityId = false +-- xowa:end + function wikibase.setupInterface() local php = mw_interface mw_interface = nil - -- Caching variable for the entity id string belonging to the current page (nil if page is not linked to an entity) - local pageEntityId = false - -- Get the entity id of the connected item, if id is nil. Cached. local function getIdOfConnectedItemIfNil( id ) if id == nil then @@ -473,6 +476,9 @@ function wikibase.notify_page_changed() -- reset cache everytime page changes entityCache = initCache( 15 ) statementCache = initCache( 50 ) + + -- reset pageEntityId on every page; ISSUE#:638; PAGE:en.s:Author:Victor_Hugo, en.s:Author:Charles_Dickens DATE:2020-03-07 + pageEntityId = false end -- xowa:end