You are here: Foswiki>Tasks Web>Item10375 (09 Jan 2015, GeorgeClark)Edit Attach

Item10375: formtemplate and add/change form fail for new topics if templatetopic is not set

pencil
Priority: Normal
Current State: No Action Required
Released In: n/a
Target Release: patch
Applies To: Engine
Component: Edit.pm
Branches:
Reported By: GilmarSantosJr
Waiting For:
Last Change By: GeorgeClark
Steps to reproduce:
  1. Create an HTML form to create new topics (form action=http://foswiki.org/bin/edit). Add formtemplate with a topic name (and not Web.Topic), say SomeForm, and don't set templatetopic
  2. Define SomeForm in the current web (can't be System)
  3. Use the HTML form
  4. In the edit screen, the Form is empty and refers to SomeForm instead of SomeForm in the current web

IF the HTML form sets some templatetopic in the current web (and the topic exists), the error doesn't occurs.

I detected this after upgrading from 1.0.9 to 1.1.2 and trying to use existing HTML forms to create new topics and replace some forms on existing topics.

Proposed patch:
--- Edit.pm.orig        2011-02-18 11:26:21.000000000 -0300
+++ Edit.pm     2011-02-18 11:25:19.000000000 -0300
@@ -387,7 +387,7 @@
     elsif ($form) {
         my $formDef;
         try {
-            $formDef = new Foswiki::Form( $session, $templateWeb, $form );
+            $formDef = new Foswiki::Form( $session, $web, $form );
         }
         catch Foswiki::OopsException with {

@@ -398,7 +398,7 @@
             # Reverse-engineer a form definition from the topic.
             # Allow OopsException to propagate
             $formDef =
-              new Foswiki::Form( $session, $templateWeb, $form, $topicObject );
+              new Foswiki::Form( $session, $web, $form, $topicObject );
         }

         # Update with field values from the query

Suggestions?

-- GilmarSantosJr - 18 Feb 2011

I have no idea what you're talking about, but I'm sure you'll be clever enough to know whether your patch is good or not smile

-- OlivierRaginel - 21 Feb 2011

Changing the feedback requirement to Gilmar - I don't understand the change, but he seems to know what the problem is. Gilmar?

-- CrawfordCurrie - 27 Apr 2011

I think this might fixed for 1.1.4 as a result of work on Item10874 and Item10446

-- PaulHarvey - 07 Jul 2011

I can't recreate the issue. Marking No Action.

-- GeorgeClark - 09 Jan 2015
 

ItemTemplate edit

Summary formtemplate and add/change form fail for new topics if templatetopic is not set
ReportedBy GilmarSantosJr
Codebase 1.1.2
SVN Range
AppliesTo Engine
Component Edit.pm
Priority Normal
CurrentState No Action Required
WaitingFor
Checkins
TargetRelease patch
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release01x01Checkins
Topic revision: r5 - 09 Jan 2015, 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