Tags:
create new tag
, view all tags

Bug: Form Topics Fail Across Webs

TWikiForms do not work across webs. If I create a form following the directions, the sourced tables do not load. This question has been posed on FormWithMultipleTopicsDoesNotWork. The person that posed the question there indicates:

"Found the problem by reading through the Perl code. The TWikiForms documentation shows examples with the web prepended to the field name (i.e. Know.TopicClassification). This will not work for multiple topic forms. The field name can not contain a reference to the web for this to work.

"Either the documentation needs to be fixed or getFormDef() in TWiki/Form.pm needs to be updated to understand field name of Know.TopicClassification rather than only understanding TopicClassification."

I have a fairly large implementation of TWiki, with around 60 webs (so far) supporting five groups. Many of them wish to use forms that are identical, or very similar. I would like to centralize the forms in a single hidden web (Reference) to simplify maintenance, but that does not work very well.

I have gotten it to work, by NOT including the web name in the master form. It seems to source the correct location during edit, but displays with the trailing "?" during view. It gets kind of confusing.

Sample master form (Reference.UnixRevForm):

| *Name* |  *Type*  |  *Size* | *Values* | *Tooltip message* |
| TopicClassification |  select    |  1 | | Select Classification |
| UnixOsType |  checkbox  |  3 | | Check O/S type |
| Reference.OsVersion |  text  |  16 | | Enter O/S Version |

and Reference.UnixOsType contains:

| *Name* |*Type*  | *Tooltip message* |
| Reference.OsSolaris | option | SUN's Solaris/<nop>SunOS |
| Reference.OsAIX | option | IBM's AIX |
| Reference.OsLinux | option | Linux |
| Reference.OsHPUX | option | HP-UX |

I'm not entirely sure if this is a bug report of a feature request...but here goes.

Test case

Environment

TWiki version: 01 Dec 2001
TWiki plugins: DefaultPlugin, ActionTrackerPlugin, CalendarPlugin, InterwikiPlugin, SmiliesPlugin, SpreadSheetPlugin, TWikiDrawPlugin, TablePlugin, TocPlugin
Server OS: SunOS 5.8
Web server: Apache 1.3.20
Perl version: v5.6.0
Client OS: Windows 2000
Web Browser: IE 5.50.4522

-- BearLimvere - 27 Mar 2002

Follow up

I was just playing with the same thing, and the change i made was (to 1-Dec-2001 release) ....

RCS file: /home/cvsroot/twiki/lib/TWiki/Form.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /tmp/T0JnaOrr   Wed Nov 27 16:33:19 2002
+++ /tmp/T1KnaOrr   Wed Nov 27 16:33:19 2002
@@ -149,8 +149,17 @@
            @posValues = split( /,\s*/, $posValuesS );
         }
 
-        if( ( ! @posValues ) && &TWiki::Store::topicExists( $webName, $name ) ) {
-            my( $meta, $text ) = &TWiki::Store::readTopic( $webName, $name );
+
+#SVEN - need to add Web.Name splitting
+        my ( $tempWeb ) = $webName;
+        my ( $tempName ) = $name;
+        if( $name =~ /^(.*)\.(.*)$/ ) {
+            $tempWeb = $1;
+            $tempName = $2;
+        }
+
+        if( ( ! @posValues ) && &TWiki::Store::topicExists( $tempWeb, $tempName ) ) {
+            my( $meta, $text ) = &TWiki::Store::readTopic( $tempWeb, $tempName );
             @posValues = getPossibleFieldValues( $text );
             if( ! $type ) {
                 $type = "select";  #FIXME keep?

however, it reminded me

why do we seperate out the webname from the topic name before we pass it into a function? Wouldn't we be better off only seperating the web and topic in the file IO functions? then this sort of issue should become automatic..... see OverrideWebInReadTopicRaw

-- SvenDowideit - 27 Nov 2002

Fix record

This should be fixed now in TWikiAlphaRelease with OverrideWebInReadTopicRaw.

Sven, could you verify?

-- PeterThoeny - 29 Nov 2002

Yep, works a charm.... sneaky way to get me to use the Alpha too smile

-- SvenDowideit - 29 Nov 2002

Category: TWikiPatches

Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2002-11-29 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.