This question about Developing extensions (plugins skins etc.): Asked
DBCALL{ topic } and INCLUDE{ topic} are not equivalent. Should they be?
Hi,
I created equivalent implementations with DBCALL and INCLUDE. The include is across two webs: Sandbox and Sandbox.TestIvDB. Code follows:
Sandbox.TestINCLUDEvsDBCALL
|
Sandbox.TestIvDB.TestINCLUDEvsDBCALL
|
---++ INCLUDE
%INCLUDE{ "Sandbox.TestIvDB.TestINCLUDEvsDBCALL" section="include" }%
---++ DBCALL
%DBCALL{ "Sandbox.TestIvDB.TestINCLUDEvsDBCALL" section="dbcall" }%
|
---++ INCLUDE
%INCLUDE{ "%TOPIC%" section="include" }%
---
<verbatim>
%STARTSECTION{ "include" }%
The INCLUDED text
%INCLUDE{ "%TOPIC%" section="include1down" }%
%ENDSECTION{ "include" }%
</verbatim>
---+++ INCLUDE 1 down
<verbatim>
%STARTSECTION{ "include1down" }%
The INCLUDED text ONE DOWN
%ENDSECTION{ "include1down" }%
</verbatim>
---++ DBCALL
%DBCALL{ "%TOPIC%" section="dbcall" }%
---
<verbatim>
%STARTSECTION{ "dbcall" }%
The DBCALLed text
%DBCALL{ "%TOPIC%" section="dbcall1down" }%
%ENDSECTION{ "dbcall" }%
</verbatim>
---+++ DBCALL 1 down
<verbatim>
%STARTSECTION{ "dbcall1down" }%
The DBCALLed text ONE DOWN
%ENDSECTION{ "dbcall1down" }%
</verbatim>
|
I expect the result to be identical. But I get:
- Support question about DBCALL vs INCLUDE:
It appears that the nested DBCALL is evaluated in the context of the BASEWEB, rather than the WEB.
Is that expected behaviour for DBCALL?
Its easy to work around by making the reference to the topic explicit: WEB.TOPIC. I thought I read somewhere that the evaluation of includes is limited to the web the included topic text is in for security reasons. Can't find that reference right now.
--
BramVanOosterhout - 31 Aug 2020