Feature Proposal: Allow Blank Topics
TWiki doesn't allowing saving blank topics. this as an
unnecessary restriction (especially when considering TWiki in the context as a backend---it's like a file system that doesn't allow you to create a file of length 0!)
Motivation
- creating topics consisting solely of attachments
- bots won't have to deal with an "empty topic" special case
- (and may act depending on the presence or absence of a topic)
Impact and Available Solutions
Documentation
Examples
edit
preview
*
oopsempty + show
view page?
save
* offer link to (or show?)
view page?
Implementation
checked into DEVELOP r3586
--
WillNorris - 01 Feb 2005
Discussion:
This is actually a necessary
feature we put in to prevent a topic from being overwritten by accident, e.g. if a user sends a URL by e-mail with
/view/ replaced by
/preview/ or
/save/. It actually happens once in a while that someone sends the preview url by email. Before the fix, an innocent person clicking on the link got a blank preview page; hitting save would wipe out the existing content.
--
PeterThoeny - 02 Feb 2005
Would that still be the case with
ReleaseLocksOnSave?
The way I understand it with no
editrev parameter it should be redirected to a preview showing that they are about to delete the topic content.
--
SamHasler - 02 Feb 2005
Good point, if the topic text can't be removed by accident I see no issue in allowing zero length topics.
--
PeterThoeny - 03 Feb 2005
I just noticed that I have
preview and
save urls in my address bar history.
It wouldn't be too hard to accidentally visit one of these.
Entering a preview url took me to
oopsempty with the message "Topic must not be empty" and save gave me the
oopssave page with the "Inproper use of the save script" message.
Try it for yourself:
--
SamHasler - 03 Feb 2005
Will: could you investigate if it is safe to remove the zero length check?
--
PeterThoeny - 04 Feb 2005
yes, absolutely Peter. i'm creating the
TestCases.
--
WillNorris - 04 Feb 2005
do the API interface and testcases above seem reasonable? are there other issues to consider regarding the lack of an
editrev parameter? i'm also interested in enhancements to the
oopsempty and
oopssave topics, although those improvements are secondary to the API update.
--
WillNorris - 05 Feb 2005
DEVELOP r3597 implements the interface described above
--
WillNorris - 06 Feb 2005
i may have broken the form button while working on this; investigating...
--
WillNorris - 08 Feb 2005
nope, it wasn't related, although i did fix the form button in DEVELOP r3601
--
WillNorris - 08 Feb 2005
DocsToDo - remove docs of existing restriction (
text param)
I removed the restriction, r3789. Note that the description of the use model above is incorrect. A save of a blank topic will proceed, and if the save is being done by the same user within the repRev period, it
will replace the text in the topic. Personally I think the best solution to this is to eliminate the risk, by disabling repRev by default.
No, I take that back; I just had a brainwave. If we always
forcenewrevision before saving a blank topic, we avoid the risk completely. So that's what 've done. r3790.
--
CrawfordCurrie - 11 Mar 2005