You are here: Foswiki>Tasks Web>Item10584 (19 Apr 2011, ColasNahaboo)Edit Attach

Item10584: %INCLUDE rev parameter does not have the same behavior if absent or empty

pencil
Priority: Normal
Current State: Closed
Released In: n/a
Target Release: n/a
Applies To: Engine
Component: FoswikiMeta, FoswikiStore, INCLUDE
Branches:
Reported By: ColasNahaboo
Waiting For:
Last Change By: ColasNahaboo
  • %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
 

ItemTemplate edit

Summary %INCLUDE rev parameter does not have the same behavior if absent or empty
ReportedBy ColasNahaboo
Codebase 1.1.2, trunk
SVN Range
AppliesTo Engine
Component FoswikiMeta, FoswikiStore, INCLUDE
Priority Normal
CurrentState Closed
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
Topic revision: r3 - 19 Apr 2011, ColasNahaboo
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