You are here: Foswiki>Tasks Web>Item5101 (16 Mar 2011, GeorgeClark)Edit Attach

Item5101: templatetopic and forms require fully qualified path names if they pointing to subwebs. Propose to allow relative path

pencil
Priority: Enhancement
Current State: Proposal Required
Released In: n/a
Target Release: minor
Applies To: Engine
Component: FoswikiTopicTemplates, SubWebs
Branches:
Reported By: TWiki:Main.VickiBrown
Waiting For:
Last Change By: GeorgeClark
I created a subweb: Friends/Vicki/Recipes.

In that subweb, I put a template, NewRecipeTemplateStrict, a TWiki Form, NewRecipeForm, and an HTML form to create a new page:

<form name="new" action="%SCRIPTURLPATH%/edit%SCRIPTSUFFIX%/%INTURLENCODE{"%WEB%"}%">
     <input type="hidden" name="action" value=form" />
     <input type="hidden" name="topicparent" value="WebHome" />
     <input type="hidden" name="onlynewtopic" value="on" />
     <input type="hidden" name="templatetopic" value="NewRecipeTemplateStrict" />
     <input type="hidden" name="topic" value="RecipeXXXXXXXXXX" />

     <input type="submit" value="Create" />
</form>

When I clicked the "Create" button, I got an error message:
Attention

"Friends/Vicki.NewRecipeTemplateStrict" topic does not exist
You are trying to templatetopic a topic that does not exist.

When I fixed that problem, the new page was created in the Friends/Vicki sub (not the Recipes subweb) and the form was "not available".

Workaround

<form name="new" action="%SCRIPTURLPATH%/edit%SCRIPTSUFFIX%/%INTURLENCODE{"%WEB%"}%">
     <input type="hidden" name="action" value=form" />
     <input type="hidden" name="topicparent" value="%WEB%.WebHome" />
     <input type="hidden" name="onlynewtopic" value="on" />
     <input type="hidden" name="templatetopic" value="%WEB%.NewRecipeTemplateStrict" />
     <input type="hidden" name="topic" value="%WEB%.RecipeXXXXXXXXXX" />

     <input type="submit" value="Create" />
</form>

Problem

Apparently, "templatetopic" and "topic" URL parameters need to be fully qualified. Unlike most topic names, they aren't assumed to be in the "current" subweb. Most odd.

-- TWiki:Main/VickiBrown - 09 Dec 2007

I don't believe this is the case in Foswiki, but it needs testing.

It is the same problem.

But I do not see it as a severe problem.

The problem arise when you call a script with a URL from an HTML form and give a template topic without the web prefix. Then it seems the edit script does not know which web to relate to. Before we fix this - we need to make sure we understand any other impact. The recent fixes we had to do on trailing / syntax shows that risk is high that fixing one thing breaks something else if we do it in a rush. So we need be careful and I prefer that we do this after 1.0.0 release. It is possible to make applications in subwebs as long as the templates are given with full path. So no release blocker.

-- KennethLavrsen - 03 Jan 2009

This is one of those rotting bugs that I consider a No Action on because noone seems motivated to drive it.

I will change it now to Enhancement.

It is in principle an change of spec and should be going through a feature proposal. But I have no drive or need to be committed developer on it.

-- KennethLavrsen - 09 Jan 2010

ItemTemplate edit

Summary templatetopic and forms require fully qualified path names if they pointing to subwebs. Propose to allow relative path
ReportedBy TWiki:Main.VickiBrown
Codebase trunk
SVN Range TWiki-4.3.0, Sun, 25 Nov 2007, build 15790
AppliesTo Engine
Component FoswikiTopicTemplates, SubWebs
Priority Enhancement
CurrentState Proposal Required
WaitingFor
Checkins
TargetRelease minor
ReleasedIn n/a
Topic revision: r7 - 16 Mar 2011, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy