Foswiki on GitHub is open for business! Next release meeting: Monday September 1, 1300Z
from TWiki:Support.DeepRecursionUsingFormfieldInForm



if I use a query search in a form to generate a value list and in the format is a $formfield I get a deep recursion. My TWiki Version is 4.2.3

The search string:
%SEARCH{ "HardwareInventoryForm.MachineTypeName~'*BladeCenter*'" 
type="query" scope="text" nonoise="on" order="topic" 
format="$formfield(MachineName)" seperator=", "}%

Here is what the apache error log shows:


TWiki version: TWikiRelease04x02x02
| TWiki plugins: | DefaultPlugin, EmptyPlugin, InterwikiPlugin, ActionTrackerPlugin, RackPlannerPlugin, RenderListPlugin, |
Server OS: RHEL 5.2, kernel 2.6.18-92.1.10.el5
Web server: Apache/2.2.3
Perl version: v5.8.8
Client OS: Ubuntu 7.10
Web Browser: Firefox 3.0.2
Categories: Forms, Search %SUPPORTCATEGORIES%

-- TWiki:Main.TobiasVonDerKrone - 15 Oct 2008

-- TWiki:Main/SvenDowideit for TWiki:Main.TobiasVonDerKrone - 18 Oct 2008

It looks like it may be a recursive tag expansion (though how it's managing to defeat the recursion block I'm not sure). We'd really need the topic, or a simplified version of it, to be able to debug this.

-- CrawfordCurrie - 20 Oct 2008

I posted an example in

-- TWiki:Main.TobiasVonDerKrone - 20 Oct 2008

Reproducible on 4.2.3, but not on 4.2.x or trunk. Confirmed. Has anyone changed the search result formatting code? It looks like there was a recursion in there.

-- TWiki:Main.CrawfordCurrie - 21 Oct 2008

I did two more tests:
  • Same error on TWiki-4.2.4, Tue, 14 Oct 2008, build 17658. Apache
log file:
  • Same error on TWiki-5.0.0, Sun, 05 Oct 2008, build 17588. Apache
log file:

-- TWiki:Main.TobiasVonDerKrone - 21 Oct 2008

I have a web which is shared between all my installs, and I can't reproduce it on TWikiRelease04x02 or trunk (both at 17701), which suggests it may be related to the configuration.

-- TWiki:Main.CrawfordCurrie - 27 Oct 2008

Tobias, I suspect you weren't really running against those versions. I ran the testcase manually, and then added unit tests to both TWikiRelease04x02 and trunk. The test definitely reproduces the failure in the expected way when run against 4.2.3, but passes clean with TWikiRelease04x02 and trunk. So I consider this fixed. If you can find a flaw in what i have done, please re-open the report.

-- CrawfordCurrie - 27 Oct 2008

Thanks. I will check this again next week and give a comment.

-- TWiki:Main.TobiasVonDerKrone - 28 Oct 2008

FYI I found that this is actually a genuine bug; the unit tests fail when they are run outside my dev environment, so I have re-opened it.

-- CrawfordCurrie - 29 Oct 2008

This was fixed before we had the bug DB up and running. For the benefit of Sopan, who had a rather different fix, here's the patch:
---   (revision 16)
+++   (revision 17)
@@ -73,6 +73,8 @@
                 topic => $form,
             }, $class );
+        $session->{forms}->{"$web.$form"} = $this;
         unless ( $def ) {
             my $store = $session->{store};
@@ -91,7 +93,6 @@
             $this->{fields} = $def;
-        $session->{forms}->{"$web.$form"} = $this;
     return $this;

ItemTemplate edit

Summary Deep recursion bug in query search
ReportedBy TWiki:Main.TobiasVonDerKrone
SVN Range TWiki-4.2.3, Wed, 06 Aug 2008, build 17396
AppliesTo Engine
Priority Urgent
CurrentState Closed
Checkins Foswikirev:17
TargetRelease patch
ReleasedIn 1.0.0
Topic revision: r5 - 22 Feb 2009, KennethLavrsen
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons License