from
TWiki:Support.DeepRecursionUsingFormfieldInForm
Question
Hello,
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:
http://tobias.vdkrone.de/files/apache_error
Environment
| 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
http://twiki.org/cgi-bin/view/Support/DeepRecursionUsingFormfieldInForm
--
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:
http://tobias.vdkrone.de/files/apache_error_17658
- Same error on TWiki-5.0.0, Sun, 05 Oct 2008, build 17588. Apache
log file:
http://tobias.vdkrone.de/files/apache_error_17588
--
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:
Index: Form.pm
===================================================================
--- Form.pm (revision 16)
+++ Form.pm (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;