This question about Using an extension: Needs followup in Tasks

RenderSimpleTopicCreator mode template creates bad html

In the topicnaming section of the RenderSimpleTopicCreator it says:
...
}%%IF{"'%mode%'='template'"
   then="<input type='hidden' name='topic' value='%FORMFIELD{"TopicNameTemplate" topic="%form%"}%' value='%value%' />$n"
}%%IF{"'%mode%'='derived'"
...

When template mode is used this renders as:
<input type='hidden' name='topic' value='NoteAUTOINC00000' value='' />
There are two value= attributes and the last one is used, ignoring the value provided.

Removing the second value= attribute makes the template mode work again. Patch follows:
diff --git a/data/Applications/RenderSimpleTopicCreator.txt b/data/Applications/RenderSimpleTopicCreator.txt
index f258f49..ea72213 100644
--- a/data/Applications/RenderSimpleTopicCreator.txt
+++ b/data/Applications/RenderSimpleTopicCreator.txt
@@ -1,4 +1,4 @@
-%META:TOPICINFO{author="ProjectContributor" comment="" date="1556788680" format="1.1"  version="1"}%
+%META:TOPICINFO{author="BaseUserMapping_333" comment="" date="1593651125" format="1.1" reprev="5" version="6"}%
 %META:TOPICPARENT{name="TopicFunction"}%
 %TOC{depth="2"}%
 
@@ -158,7 +158,7 @@ This function renders a topic creator form that holds a set of initial input ele
 %STARTSECTION{"topicnaming"}%%IF{"'%mode%'=~'^(default)?$'"
    then="<input type='hidden' name='topic' class='jqWikiWord' data-source='input[name=TopicTitle]' data-transliterate='true' value='%value%' />$n"
 }%%IF{"'%mode%'='template'"
-   then="<input type='hidden' name='topic' value='%FORMFIELD{"TopicNameTemplate" topic="%form%"}%' value='%value%' />$n"
+   then="<input type='hidden' name='topic' value='%FORMFIELD{"TopicNameTemplate" topic="%form%"}%' />$n"
 }%%IF{"'%mode%'='derived'"
    then="<input type='hidden' name='topic' class='jqWikiWord' value='%value%' $percntDBQUERY{
                 topic=\"%form%\"

-- BramVanOosterhout - 02 Jul 2020

Well spotted! Will be fixed in the next release.

-- MichaelDaum - 02 Jul 2020
 

QuestionForm edit

Subject Using an extension
Extension WikiWorkbenchContrib
Version Foswiki 2.1.6
Status Needs followup in Tasks
Related Topics
Topic revision: r2 - 02 Jul 2020, MichaelDaum
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