• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item5701: tempatetopic not implemented as per the docco in TWikiScripts

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine   Urgent Closed   patch 4.2.1, 5.0.0

Edit Form Data

Reported By:
Applies To:
Current State:
Waiting For:
Target Release:
Released In:


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

Summary tempatetopic not implemented as per the docco in TWikiScripts
ReportedBy TWiki:Main.SvenDowideit
Codebase 4.2.1, ~twiki4
SVN Range TWiki-5.0.0, Sun, 01 Jun 2008, build 16865
AppliesTo Engine

Priority Urgent
CurrentState Closed

Checkins TWikirev:16936 TWikirev:16937
TargetRelease patch
ReleasedIn 4.2.1, 5.0.0
Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r8 - 2008-08-04 - KennethLavrsen
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback