Item10584: %INCLUDE rev parameter does not have the same behavior if absent or empty
Priority: Normal
Current State: Closed
Released In: n/a
Target Release: n/a
- %INCLUDE{X rev=""}% fetches the last version in RCS, ignoring the .txt file
- %INCLUDE{X}% fetches the .txt file
This is normally the same, but makes foswiki ignore hand-edited or machine-generated pages if the template uses %INCLUDEs, as one must use constructs like
%INCLUDE{"%TOPIC%" section="MAIN" rev="%URLPARAM{rev}%"}%
for the "show previous version" functionality to work
Workaround is to not use
- %INCLUDE{"%TOPIC%" section="MAIN" rev="%URLPARAM{rev}%"}%
but
- %INCLUDE{"%TOPIC%" section="MAIN" %IF{"defined 'rev'" then="rev=\"%URLPARAM{rev}%\""}%}%
To reproduce:
[1] edit a wiki topic with the contents:
OLD CONTENT
%STOPINCLUDE%
---
%INCLUDE{"%TOPIC%" rev=""}%
[2] by hand on the machine, change OLD by NEW in topic .txt file
[3] if the bug is present (1.1.2) you will see:
NEW CONTENT
---
OLD CONTENT
If the foswiki engine works correctly (1.0.9) you will see:
NEW CONTENT
---
NEW CONTENT
--
ColasNahaboo - 01 Apr 2011
Tested on 1.1.3, bug is fixed! Closing it
--
ColasNahaboo - 19 Apr 2011