wow - this code has gone off. there's a
newtopic
urlparam to Save Script that isn't doccoed, and does something odd too.
SaveScriptTests::test_templateTopicTextSave
unit test seems to assert the exact opposite of the docco (the code thinks that once a topic exists the templatetopic is irrelevant) :
- The new text is taken from the text parameter, if it is defined,
- otherwise it is taken from the templatetopic, if it is defined,
- otherwise it is taken from the previous version of the topic, if any,
and I think the same thing is occurring for META.
I think the doccoed version is superior - comments?
I'm setting this to urgent, as its been a lingering complaint that Lynnwood was going to put in a bug report for, and I also have been expending too much effort into workarounds for it.
another example:
my $mum;
if( $newParent ) {
if( $newParent ne 'none' ) {
$mum = { 'name' => $newParent };
}
} elsif( $templateMeta ) {
$mum = $templateMeta->get( 'TOPICPARENT' );
} elsif( $prevMeta ) {
$mum = $prevMeta->get( 'TOPICPARENT' );
}
$newMeta->put( 'TOPICPARENT', $mum ) if $mum;
seems to me to be broken because while there might be a $templateMeta, it may not have a TOPICPARENT set - in which case the $prevMeta should be used.
none of these bugs matter to
most users until they start to craft Save URL's manually for applications - but at that point, they become vital.
--
TWiki:Main.SvenDowideit - 13 Jun 2008
having played around a little with the code, and seen that the redefinition occurred between Cairo and 4 I'm leaning towards leaving
templatetopic
as it is, only used for new topic creation, and instead making a
texttemplate
and
settingstemplate
to go with the
formtemplate
setting (which does work at any time), so that the twiki app developer can control precisly which part of a topic to copy into another.
--
TWiki:Main.SvenDowideit - 13 Jun 2008
Sounds like a feature proposal candidate to me.
And one you will get my support for.
--
TWiki:Main.KennethLavrsen - 13 Jun 2008
y, and safer too: actually, its an amendment to
TWiki:Codev.AddSettingsTopicParamToEditAndSave
this Bug is morphing into a docco fix for 4.2.1
--
TWiki:Main.SvenDowideit - 13 Jun 2008
I vaguely remember asking for clarification on this one, because I couldn't understand why on earth you would ever want it to work the way it did. To me,
templatetopic
means "a topic to be used as a template when creating a new topic", rather than "a means to blow away any
text
parameter you might pass to the save". I agree with your conclusions, though long term I might have preferred to see a mechnanism by which I could template any part of a topic that is indexable under the terms of the
QuerySearch syntax.
--
CrawfordCurrie - 14 Jun 2008
I'm doing a docco fix for
TWikiScripts, and will move the enhancement info to
TWiki:Codev.AddSettingsTopicParamToEditAndSave
--
SvenDowideit - 25 Jun 2008