• 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.

Item5412: "You are trying to templatetopic a topic that does not exist" makes no sense

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine   Normal Closed   patch  

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

When you create a new topic from a template that does not exist, what should the message be?

-- TWiki:Main.ArthurClemens - 03 Mar 2008

"You are trying to create a topic using a templatetopic that does not exist" would be my best proposal

-- TWiki:Main.KennethLavrsen - 03 Mar 2008

in messages.tmpl

%TMPL:DEF{"no_such_topic"}%
---++ %MAKETEXT{"[_1] topic does not exist" args="\"%WEB%.%TOPIC%\""}%
%MAKETEXT{"You are trying to [_1] a topic that does not exist." args="%PARAM1%"}%

---++ %MAKETEXT{"If you want to create the topic"}%
[[%SCRIPTURLPATH{"edit"}%/%WEB%/%TOPIC%?t=%SERVERTIME{"$year$mo$day$min$sec"}%][%MAKETEXT{"Create the topic"}%]].

%MAKETEXT{"Contact [_1] if you have any questions." args="%WIKIWEBMASTER%"}%
%TMPL:END%

Which is then used in TWiki::UI::Edit

             unless( $store->topicExists( $templateWeb, $templateTopic )) {
                throw TWiki::OopsException(
                    'accessdenied',
                    def => 'no_such_topic',
                    web => $templateWeb,
                    topic => $templateTopic,
                    params => [ 'templatetopic' ] );
            }

TWiki::UI::Save

     if( $templatetopic ) {
        ( $templateweb, $templatetopic ) =
          $session->normalizeWebTopicName( $templateweb, $templatetopic );

        unless( $store->topicExists( $templateweb, $templatetopic )) {
            throw TWiki::OopsException(
                'attention',
                def => 'no_such_topic',
                web => $templateweb,
                topic => $templatetopic,
                params => [ 'template from' ] );
        }
    }

TWiki::UI::Manage

     unless( $session->{store}->topicExists( $oldWeb, $oldTopic )) {
        # Item3270: check for the same name starting with a lower case letter.
        unless( $session->{store}->topicExists( $oldWeb, lcfirst $oldTopic )) {
            throw TWiki::OopsException(
                'accessdenied',
                def => 'no_such_topic',
                web => $oldWeb,
                topic => $oldTopic,
                params => [ 'rename' ] );
        }
        $oldTopic = lcfirst $oldTopic;
    }

and TWiki::UI

 sub checkTopicExists {
    my ( $session, $webName, $topic, $op ) = @_;
    ASSERT($session->isa( 'TWiki')) if DEBUG;

    unless( $session->{store}->topicExists( $webName, $topic )) {
        throw TWiki::OopsException( 'accessdenied',
                                    def => 'no_such_topic',
                                    web => $webName,
                                    topic => $topic,
                                    params => [ $op ] );
    }
}

.... The case that Arthur reports is the one in TWiki::UI::Edit, but it feels to me like the others could also do with a little improvement.

HOWEVER the parameters to the MAKETEXTs are not translated, are they - which makes the entire thing a wee bit awkward.

-- TWiki:Main.SvenDowideit - 03 Apr 2008

It would make more sense to have a number of complete and translatable variations.

-- TWiki:Main.ArthurClemens - 03 Apr 2008

Done like this. Let's not forget to ask the translators to translate the new messages.

-- TWiki:Main.ArthurClemens - 03 May 2008

ItemTemplate
Summary "You are trying to templatetopic a topic that does not exist" makes no sense
ReportedBy TWiki:Main.ArthurClemens
Codebase

SVN Range TWiki-5.0.0, Wed, 23 Jan 2008, build 16283
AppliesTo Engine
Component

Priority Normal
CurrentState Closed
WaitingFor

Checkins TWikirev:16763 TWikirev:16764
TargetRelease patch
ReleasedIn

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-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback