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

I have a TWiki application with label form fields in the TWiki Form. If a label contains a WikiWord, garbage is shown for the label field in edit mode, content gets destroyed after save.

Form content before edit/save cycle: (Cairo format)

META:FIELD{name="Classification" title="Classification" value="DocDB"}
META:FIELD{name="File" title="File" value="WikisInEnterprise.pdf"}

Both are of label type.

Form content after edit/save cycle: (Dakar format)

META:FIELD{name="Classification" attributes="" title="Classification" value="<a href="}
META:FIELD{name="File" attributes="" title="File" value="<span class="}

This bug prevents me from updating a site to Dakar since it destroys data.

-- PTh

I tried to reproduce it at TestTemplate but could not. Apparently it happens with a 1.0 format topic that gets converted to 1.1 format.

-- PTh

Please attach a topic with the 1.0 format that get's garbled (check previous revision of the topic you're using) so we can properly test.

-- RA

See attached tt.zip file. Also copied on this server to Sandbox.DocForm, Sandbox.DocID1, Sandbox.DocID2.

-- PTh

Locally, I have the full generated XHTML put in the field generated after save (not only the part until first "). (BTW, danish I18N in this paste, s/Opret/Create/).

%META:FIELD{name="Attachment" attributes="" title="Attachment" value="<span class=%22twikiNewLink%22>WikisInEnterprise<a rel=%22nofollow%22 href=%22/twiki/bin/edit/Sandbox/WikisInEnterprise?topicparent=Sandbox.DocID20051218224242%22 title=%22Opret denne side%22><sup>?</sup></a></span>.pdf"}% 

-- SP

A simple fix for this would be to simply not call getRenderedVersion for labels. But I can't figure why it is called in the first place, I'd like to get a second opinion if it can just be eliminated. Any ideas?

Index: lib/TWiki/Form.pm
--- lib/TWiki/Form.pm   (revision 8760)
+++ lib/TWiki/Form.pm   (working copy)
@@ -444,8 +444,7 @@
         # necessarily identical to what is in the form? If we can
         # take it from the text, we must be sure it cannot be
         # changed through the URL?
-        my $renderedValue = $session->{renderer}->getRenderedVersion
-          ( $session->handleCommonTags( $value, $web, $topic ));
+        my $renderedValue = $session->handleCommonTags( $value, $web, $topic );
         $value = CGI::hidden( -name => $name,
                               -class => 'twikiEditFormLabelField',
                               -value => $renderedValue );

-- SP

Fixed in SVN 8770.

Rendering must not be done for hidden form field value of label field, but it still needs to be done for the label text that is displayed. (Reverting back to how it was in Cairo.)

Modified: twiki/branches/DEVELOP/lib/TWiki/Form.pm
--- twiki/branches/DEVELOP/lib/TWiki/Form.pm   2006-02-11 02:32:53 UTC (rev 8769)
+++ twiki/branches/DEVELOP/lib/TWiki/Form.pm   2006-02-12 05:41:12 UTC (rev 8770)
@@ -439,16 +439,12 @@
                                  -value => $value );
     } elsif( $type eq 'label' ) {
-        # Interesting question: if something is defined as "label",
-        # could it be changed by applications or is the value
-        # necessarily identical to what is in the form? If we can
-        # take it from the text, we must be sure it cannot be
-        # changed through the URL?
+        # Changed labels through the URL is a feature for TWiki applications
         my $renderedValue = $session->{renderer}->getRenderedVersion
           ( $session->handleCommonTags( $value, $web, $topic ));
         $value = CGI::hidden( -name => $name,
                               -class => 'twikiEditFormLabelField',
-                              -value => $renderedValue );
+                              -value => $value );
         $value .= CGI::div( { class => 'twikiEditFormLabelField' },
                             $renderedValue );

-- PTh

merged in r9211

-- RA

Closed with the release of 4.0.2


Summary Label form field content destroyed
ReportedBy TWiki:Main.PeterThoeny

SVN Range Thu, 02 Feb 2006 build 8675
AppliesTo Engine

Priority Urgent
CurrentState Closed

Checkins 8770 9211
TargetRelease patch
Topic attachments
I Attachment History Action Size Date Who Comment
GIFgif image15.gif r1 manage 2.6 K 2006-02-09 - 23:55 PeterThoeny  
Compressed Zip archivezip tt.zip r1 manage 3.0 K 2006-02-10 - 20:36 PeterThoeny Form topic and doc topic with form and comment field
Edit | Attach | Watch | Print version | History: r11 < r10 < r9 < r8 < r7 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r11 - 2006-04-01 - KennethLavrsen
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback