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:
    DBCALLSupport.JPG

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

 

QuestionForm edit

Subject Developing extensions (plugins skins etc.)
Extension DBCachePlugin
Version Foswiki 2.1.6
Status Asked
Related Topics
I Attachment Action Size Date Who Comment
DBCALLSupport.JPGJPG DBCALLSupport.JPG manage 22 K 31 Aug 2020 - 10:21 BramVanOosterhout Support question about DBCALL vs INCLUDE
Topic revision: r1 - 31 Aug 2020, BramVanOosterhout
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy