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.)
--
TWiki:Main/VickiBrown
- 08 Aug 2008
This is duplicate of
Item6163.
--
TWiki:Main/PeterThoeny
- 28 Feb 2010