NOTE: If you are a developer, please use a private wiki based on foswiki/trunk on a daily base ...or use trunk.foswiki.org to view this page for some minimal testing.
Use Item11383 for general documentation changes for release 1.1.5. Use Item9693 for docu changes for release 2.0.

Item5897: If COMMENT specifies target and target is missing, content disappears

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Normal Confirmed Extension CommentPlugin  
If COMMENT specifies a target, e.g.
%COMMENT{type="logbook" templatetopic="VickiCommentTemplate"  target="%WEB%.%INCLUDINGTOPIC%#AnchorHere"}% 

and the target ( #AnchorHere) is not found

COMMENT will discard the results.

Instead of making the data disappear, COMMENT should default to whatever behaviour it would have expressed without a specified "target" parameter - e.g. put the content BEFORE or AFTER the comment box.

Sample Template

%TMPL:DEF{PROMPT:testpost}%
<table  valign="top">
<tr>
<td>
<textarea %DISABLED% rows="10" cols="80" name="testpost_summary" wrap="soft"></textarea>
</td>
</tr>
<tr>
<td colspan="2" align="center">
   <input type="submit" value="Test Post" />
</td>
</tr>
</table>%TMPL:END%



%TMPL:DEF{OUTPUT:testpost}%

%POS:AFTER% 

%URLPARAM{"testpost_summary"}%

 -- %WIKIUSERNAME% %DATE%
---

%TMPL:END% 

-- TWiki:Main/VickiBrown - 07 Aug 2008

Hmmm, that's a tough call. Some would say it should generate an alert, otherwise it will appear that the comment plugin is stuffing comments where they aren't wanted. Imagine if the target is another topic, and you don't have write permission in the current topic (a typical pattern). The comment plugin would fail reporting that access was denied on the topic that isn't the target; very confusing!

Confirmed and reclassified as enhancement.

-- CrawfordCurrie - 08 Aug 2008

If the target is in a topic where you don't have authorization, I agree an alert is appropriate.

If the target is missing, perhaps COMMENT could act like INCLUDE and notice and put up a red warning that the target doesn't exist.

But in either case, causing everything you typed to disappear is inappropriate. COMMENT plugin is used for so much more than "commentary". In this case, we're creating Runbooks. When the engineer spends time typing in an instruction and it just disappears when he click submit, that's wrong.

I'm much more concerned by the disappearance of the content. The implementation details don't worry me much. (Preventing data loss is a bug fix, not an enhancement.)


I suspect I fixed this when I worked on Timothe's fix, i'll have to look :/

-- SvenDowideit - 08 Feb 2009

In my testing for unrelated stuff, it appears that CommentPlugin will create the target if it's missing. I didn't test what happens if the create is not permitted.

-- GeorgeClark - 14 Jan 2012

Trunk version of CommentPlugin causes a crash if ASSERTs are enabled, and user attempts to create a missing topic in web that the user cannot modify. With ASSERT disabled, the user gets an OOPS failure for the access exception. Task11443?

ItemTemplate edit

Summary If COMMENT specifies target and target is missing, content disappears
ReportedBy TWiki:Main.VickiBrown
Codebase
SVN Range TWiki-5.0.0, Sun, 03 Aug 2008, build 17280
AppliesTo Extension
Component CommentPlugin
Priority Normal
CurrentState Confirmed
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches?
trunkCheckins
Release01x01Checkins?
Topic revision: r6 - 15 Jan 2012 - 06:02:15 - GeorgeClark
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons LicenseGet Foswiki at sourceforge.net. Fast, secure and Free Open Source software downloads