Item9128: Combining TABLE2EXCEL with SEARCH causes apache error!
Combining TABLE2EXCEL with
SEARCH fails!
Here is an example use:
%TABLE2EXCEL{}%
| *Name* | *Title* | *Author* |
%SEARCH{"<search stuff>" type="query" nosearch="on" format="| [[$topic]] | $formfield(DocumentTitle) | $formfield(DocumentAuthor) |" }%
Clicking on the "export" button gives:
Foswiki detected an internal error - please check your Foswiki logs and webserver logs for more information.
Can't locate object method "_SEARCH" via package "Foswiki"
Apache says:
[Tue Jun 08 16:14:12 2010] [error] [client 192.168.81.105] Can't locate object method "_SEARCH" via package\
"Foswiki" at /var/lib/foswiki/lib/Foswiki/Plugins/ExcelImportExportPlugin/Export.pm line 679., referer: ht\
tp://someurl/foswiki/bin/view/Someplace/ReadyToGo
This is version: foswiki-excelimportexportplugin 090313-205
--
BigBaaadBob - 08 Jun 2010
I can confirm this with most recent debian packages from fosiki.org.
Interestingly, the error also appears when the
SEARCH is not actually generating the content of the table, but also if a
SEARCH is embedded in an EDITTABLE string (here: for a "select" list).
Another error message (apache2) says:
[Mon Jun 28 13:12:04 2010] [error] [client XXX.XXX.XXX.197] Use of uninitialized value within %type in string eq at
/var/lib/foswiki/lib/Foswiki/Plugins/ExcelImportExportPlugin/Export.pm line 750 (#1), referer: http://XXX.XX/Sandbox/ExcelExportTest
BTW: There is also a bug about the debian package, as I had to make the scripts in /var/lib/foswiki/bin executable
manually.
--
PhilippLeufke - 28 Jun 2010
I'm no expert - but the offending code for the _SEARCH error may stem from:
my ( $meta, $text ) = Foswiki::Func::readTopic( $web, $basetopic );
$text =~ s/%SEARCH{(.*)}%/$session->_SEARCH( new Foswiki::Attrs($1), $basetopic, $web )/geo;
--
DanielReichert - 21 Jul 2010
I replaced the above line with:
my $topicObject = Foswiki::Meta->new( $session, $web, $basetopic );
$text = $topicObject->expandMacros($topicObject->text());
and that seems to work for me. I don't know anything about the code, though.
--
MathijsMHlmann - 20 Mar 2012