Item13607: find-elsewhere does not link correctly wiki words in INCLUDEd sections
Priority: Normal
Current State: Confirmed
Released In: n/a
Target Release:
How to repro:
Create a topic in
Sandbox.FindElsewherePluginTest
with content:
%STARTINCLUDE%
TEST1:
Foswiki 2.0.1 extensions released: AutoViewTemplatePlugin, CommentPlugin, JsonRpcContrib, NatEditPlugin, PlainFileStoreContrib, SpreadSheetPlugin, SubscribePlugin, TipsContrib and UpdatesPlugin _03 Aug 2015_
TEST2:
Foswiki 2.0.1 extensions released: AutoViewTemplatePlugin , CommentPlugin , JsonRpcContrib , NatEditPlugin , PlainFileStoreContrib , SpreadSheetPlugin , SubscribePlugin , TipsContrib and UpdatesPlugin _03 Aug 2015_
%STOPINCLUDE%
Create a second topic
Main.FindElsewherePluginTestINCLUDE
in some other web with content:
%INCLUDE{"Sandbox.FindElsewherePluginTest"}%
Now see which of these links properly link to the plugin topics in System ... and which not.
This error is due to the way the current web is tracked and how it affects included sections. There is a global variable
$thisWeb
being initialized in
initPlugin
and being used as part of the
preRenderingHandler
.
This variable is then used to resolve links ... and becomes totally confused.
INCLUDE rewrites WikikWords in included text too early before
FindElsewherePlugin is able to rewrite it by itself. The notion of
LOOKELSEWHEREFORLOCAL
compicates it even more.
The intention of
LOOKELSEWHEREFORLOCAL
seems to be to still look elsehwere even when (a) the wiki word has got a web specifier and (b) this web points to the same web the plugin is called in.
From the perspective of an
INCLUDE things are different
as all wiki words have already been rewritten to have a a web specifier. So this condition becomes queasy. At this point in the rendering pipeline
we simply dont know whether the wiki word has got a
user specified web prefix or if it was added by
INCLUDE. In the first name you might probably really want to point to a specific web.topic, whereas
the latter needs a find-elsewhere treatment.
I am afraid this can't be resolved without breaking eggs.
--
MichaelDaum - 04 Aug 2015