Bug: Search and SpreadSheetPlugin Problem
There appears to be some issue with using functions from the
SpreadSheetPlugin in a formatted search. I was trying to use a spreadsheet calculation on the row retrieved from the search, but don't seem to get it to work. Of course, there is no problem using spreadsheet functions in the last row of the search.
See the test case below...
Test case
Consider the following query (the nop are there to prevent premature interpretation)...
<form action="%SCRIPTURLPATH%/search%SCRIPTSUFFIX%/%INCLUDINGWEB%/">
<input type="hidden" name="scope" value="True" />
<input type="hidden" name="regex" value="on" />
<input type="hidden" name="web" value="Main" />
<input type="text" name="search" size="32" />
<input type="submit" value="Search" /> <br>
<input type="hidden" name="header" value="|*Installation*|*Description*|*More*|" />
<input type="hidden" name="format" value="|[<nop>[$web.$topic][$formfield(<nop>TWikiInstalledAt)]] | $formfield(<nop>TypeOfOrganization) | %CALC{"$T(R$ROW():C$COLUMN(-1))" }% |" />
Type
Motorola;Corporate into the form below. You will see that the spreadsheet calculation returns nothing (at least, nothing visible).
Extra question... the query
|*Installation*|*Description*|*Computed*|
%SEARCH{ "Motorola;Corporate;Firewalled" scope="true" regex="on" web="Main" nototal="on" nosearch="on" format="|[[$web.$topic][$formfield(TWikiInstalledAt)]] |$formfield(TypeOfOrganization) | $percntCALC{\"$T(R$ROW():C$COLUMN(-1))\"}$percnt |" }%
appears to be the same as above, but produces even more unsuspected results...
Topic |
OperatingSystem |
Computed |
| Total: 89 |
OsHPUX: 3 OsHPUX, OsLinux, OsMacOS, OsSolaris, OsSunOS, OsWin: 1 OsHPUX, OsLinux, OsMacOS, OsSolaris, OsSunOS, OsWin, OsTen: 4 OsHPUX, OsSolaris: 1 OsHPUX, OsSolaris, OsTen: 1 OsHPUX, OsSolaris, OsTen, OsLinux, OsSunOS, OsMacOS, OsWin: 1 OsHPUX, OsSunOS: 1 OsHPUX, OsWin: 1 OsLinux: 16 OsLinux, OsMacOS: 1 OsLinux, OsWin: 1 OsMacOS: 2 OsMacOS, OsWin: 1 OsSolaris: 3 OsSolaris, OsSunOS, OsWin: 1 OsSunOS: 1 OsWin: 14 OsWin, OsTen: 1 |
OsHPUX: 3 OsHPUX, OsLinux, OsMacOS, OsSolaris, OsSunOS, OsWin: 1 OsHPUX, OsLinux, OsMacOS, OsSolaris, OsSunOS, OsWin, OsTen: 4 OsHPUX, OsSolaris: 1 OsHPUX, OsSolaris, OsTen: 1 OsHPUX, OsSolaris, OsTen, OsLinux, OsSunOS, OsMacOS, OsWin: 1 OsHPUX, OsSunOS: 1 OsHPUX, OsWin: 1 OsLinux: 16 OsLinux, OsMacOS: 1 OsLinux, OsWin: 1 OsMacOS: 2 OsMacOS, OsWin: 1 OsSolaris: 3 OsSolaris, OsSunOS, OsWin: 1 OsSunOS: 1 OsWin: 14 OsWin, OsTen: 1 |
| AddEntryInPastartXML |
|
|
| AmIstillCONFUSED |
OsLinux |
OsLinux |
| ANewTopic |
OsWin |
OsWin |
| AnotherTest |
OsWin |
OsWin |
| ArtForTWiki |
OsHPUX, OsLinux, OsMacOS, OsSolaris, OsSunOS, OsWin, OsTen |
OsHPUX, OsLinux, OsMacOS, OsSolaris, OsSunOS, OsWin, OsTen |
| BibtexID |
OsHPUX, OsLinux, OsMacOS, OsSolaris, OsSunOS, OsWin |
OsHPUX, OsLinux, OsMacOS, OsSolaris, OsSunOS, OsWin |
| CategoryTableTestPage |
OsLinux |
OsLinux |
| CheckThisOut |
OsHPUX |
OsHPUX |
| ConejoInstall |
OsLinux |
OsLinux |
| CowsWithGuns |
OsSolaris |
OsSolaris |
| CustomVariablesInTemplates |
OsHPUX |
OsHPUX |
| Know.Database |
|
|
| DebrisPages |
|
|
| DoesThisReallyWork |
OsSolaris |
OsSolaris |
| DonnaEnriq |
|
|
| EvaluatingKnowledgeBaseSoftware |
|
|
| FiddlingDoMeBobber |
OsWin |
OsWin |
| FindingTheGoBox |
OsHPUX, OsLinux, OsMacOS, OsSolaris, OsSunOS, OsWin, OsTen |
OsHPUX, OsLinux, OsMacOS, OsSolaris, OsSunOS, OsWin, OsTen |
| FxDriver |
|
|
| GaryKnowTest |
|
|
| GetTWikiExpertise |
OsLinux |
OsLinux |
| HowToUseKnow |
|
|
| Know.Hungy |
|
|
| ImCold |
|
|
| IncorrectDllVersionW32PTH10DLL |
OsWin |
OsWin |
| InfiniteMonkeysDoNotActuallyProduceLiterature |
OsWin |
OsWin |
| InstallationOnWindows |
OsWin |
OsWin |
| ItemNumber00905 |
|
|
| JespersProblem |
OsHPUX, OsSolaris, OsTen |
OsHPUX, OsSolaris, OsTen |
| JimminyChristmas |
OsHPUX, OsSolaris |
OsHPUX, OsSolaris |
| JobFileSphericalBuggy |
OsMacOS, OsWin |
OsMacOS, OsWin |
| JustATest |
|
|
| KbEntriesUnderCategories |
|
|
| Know.Kevindll |
OsLinux |
OsLinux |
| Know.Know123 |
OsLinux |
OsLinux |
| KnowPingPong |
|
|
| KnowTest |
OsWin |
OsWin |
| KnowTestBase |
OsLinux |
OsLinux |
| LightsAreOff |
OsLinux |
OsLinux |
| LinuxRsync |
OsLinux |
OsLinux |
| MeinToasterBrennt |
OsWin, OsTen |
OsWin, OsTen |
| MetaFieldSearch |
|
|
| MoneticaTest |
|
|
| MoneticaTest2 |
OsLinux |
OsLinux |
| MyKnowledge |
|
|
| MyOwnTopic |
OsMacOS |
OsMacOS |
| MyProblem |
OsSunOS |
OsSunOS |
| MyTestTopic |
OsWin |
OsWin |
| NewEntryTest |
OsHPUX, OsSunOS |
OsHPUX, OsSunOS |
| NewKBArticle |
OsWin |
OsWin |
| NewTopic |
|
|
| NoBackgroundReading |
OsWin |
OsWin |
| NotSearch |
|
|
| OpenGLDrivers |
OsWin |
OsWin |
| PastartXML |
|
|
| PutThemOutToPasture |
OsLinux |
OsLinux |
| RabbitHunting |
|
|
| ReadmeFirst |
OsMacOS |
OsMacOS |
| ReportError |
OsWin |
OsWin |
| RichTestTopic |
OsSolaris, OsSunOS, OsWin |
OsSolaris, OsSunOS, OsWin |
| SearchWithHighlights |
|
|
| SimpleTestTopic |
OsLinux, OsMacOS |
OsLinux, OsMacOS |
| SomeNewFAQ |
OsLinux |
OsLinux |
| SomethingOrOther |
OsLinux |
OsLinux |
| StarTacPhoneSync |
|
|
| StillTryingToMakeAPracticeQ |
OsHPUX |
OsHPUX |
| SuomiFinland |
|
|
| TestfoobarError |
OsHPUX, OsWin |
OsHPUX, OsWin |
| TestingANDWithFormSearch |
OsWin |
OsWin |
| TestKBEntry |
OsHPUX, OsSolaris, OsTen, OsLinux, OsSunOS, OsMacOS, OsWin |
OsHPUX, OsSolaris, OsTen, OsLinux, OsSunOS, OsMacOS, OsWin |
| TestKlaus |
OsLinux, OsWin |
OsLinux, OsWin |
| TestKnow |
OsLinux |
OsLinux |
| TestMyWiki |
OsWin |
OsWin |
| TestVariableInFormField |
|
|
| ThisIsMyProblem |
OsLinux |
OsLinux |
| TktNum1234 |
|
|
| TktNum12345 |
|
|
| TktNum4321 |
|
|
| TryToCreateNewQuestion |
|
|
| TWikiArt |
OsHPUX, OsLinux, OsMacOS, OsSolaris, OsSunOS, OsWin, OsTen |
OsHPUX, OsLinux, OsMacOS, OsSolaris, OsSunOS, OsWin, OsTen |
| TWikiPrimer |
|
|
| UselessTestTopic |
|
|
| WebAccess |
|
|
| WebIndex |
|
|
| WebLeftBar |
|
|
| WebTopicEditTemplate |
|
|
| WhereToEnterNewProblem |
OsHPUX, OsLinux, OsMacOS, OsSolaris, OsSunOS, OsWin, OsTen |
OsHPUX, OsLinux, OsMacOS, OsSolaris, OsSunOS, OsWin, OsTen |
| WooHoo |
OsLinux |
OsLinux |
| WrkTest |
OsSolaris |
OsSolaris |
Environment
| TWiki version: |
Athens, Beijing |
| TWiki plugins: |
twiki.org |
| Server OS: |
|
| Web server: |
|
| Perl version: |
|
| Client OS: |
|
| Web Browser: |
|
--
ThomasWeigert - 06 May 2003
Follow up
On search with form & search script:
The search script is built for speed, e.g. it outputs search hit by search hit while the search is going on, so that the browser can start rendering the result quickly. That is why you do not see a correct evaluation of the formula. A formatted search that is embedded (a SEARCH) does render the result in memory, e.g. it is slower but supports regular formatting, as with CALC.
As a workaround you can create a topic that has a SEARCH with embedded URLPARAM. From your form you can call that topic. An example in action is
TWikiInstallation.
On embedded SEARCH:
There are two bugs in your example. You need to "defuse" the CALC or it gets executed before the SEARCH, e.g. use
$percnt instead of
%, use
\" or
$quot instead of
". I fixed above example. Read the details in
FormattedSearch.
No fix planned because of above reasons.
--
PeterThoeny - 07 May 2003
Fix record