Item8230: Edittable is replacing SpreadSheetPlugin-formulas with the text "CALC" in headers and footers
Priority: Urgent
Current State: Closed
Released In: 1.0.7
Target Release: patch
If you have the following topic (only a cutout):
---+ Tagesbericht für %CALC{"$FORMATTIME($TIME(%META{"formfield" name="Datum"}%), $weekday, $day.$month.$year)"}%
%EDITTABLE{format="| text, 5|text, 5|text, 3|text, 2|text, 2|text, 4|text, 20|"}%
%TABLE{disableallsort="on" footerrows="1" tablerules="all"}%
| *Zeit* | *BZ* | *BE* | *pra* | *bas* | *kg* | *Kommentar* |
| | | | | | | |
| | %CALC{"$SET(durchschnittbz, $FORMAT(NUMBER, 2, $AVERAGE($ABOVE())))"}% %CALC{"$GET(durchschnittbz)"}% | %CALC{"$SET(summebe, $SUM($ABOVE()))"}% %CALC{"$GET(summebe)"}% | %CALC{"$SET(summeprandial, $SUM($ABOVE()))"}% %CALC{"$GET(summeprandial)"}% | %CALC{"$SET(summebasal, $SUM($ABOVE()))"}% %CALC{"$GET(summebasal)"}% | %CALC{"$SET(kg, $FORMAT(NUMBER, 1, $AVERAGE($ABOVE())))"}% %CALC{"$GET(kg)"}% | |
then the beautiful formulas in the footerrow are replaced with the text "CALC CALC" on editing the table with the EDITTABLE-button. This "CALC"-texts are displayed immediately in the form and saved as text "CALC CALC" on saving the table.
Workaround: if you write
[...]
%EDITTABLE{format="| text, 5|text, 5|text, 3|text, 2|text, 2|text, 4|text, 20|" disableallsort="on" footerrows="1"}%
%TABLE{tablerules="all"}%
| *Zeit* | *BZ* | *BE* | *pra* | *bas* | *kg* | *Kommentar* |
[...]
then the formulas are preserved (but also displayed while editing the table).
Foswiki-1.0.6, Sun, 21 Jun 2009, build 4272 (Debian 1.0.6-2 on Ubuntu 8.10),
EditTablePlugin (4.3, $Rev: 4208 (2009-06-19) $),
SpreadSheetPlugin (11 May 2009, $Rev: 3890 (2009-05-11) $).
--
WolfgangRaus - 06 Aug 2009
Raising this as urgent, because this is a regression due to some tweaking and I'm fearing it's worse than what Wolgang reports.
Assigning it to Kenneth because he wrote that part.
--
OlivierRaginel - 06 Aug 2009
It was actually Arthur that added the CALC feature also to header and footer. And the code that handles the label columns does is not implemented for headers and footers. So the quick and easy work around is.
Index: lib/Foswiki/Plugins/EditTablePlugin/Core.pm
===================================================================
--- lib/Foswiki/Plugins/EditTablePlugin/Core.pm (revision 4746)
+++ lib/Foswiki/Plugins/EditTablePlugin/Core.pm (working copy)
@@ -746,7 +746,7 @@
# a header row will not be edited, so do not render table row with handleTableRow
- _handleSpreadsheetFormula($_);
+ # _handleSpreadsheetFormula($_);
_debug("RENDER ROW: HEADER:rowNr=$rowNr; id=$rowId=$_");
push( @headerRows, $_ );
}
@@ -763,7 +763,7 @@
# a footer row will not be edited, so do not render table row with handleTableRow
- _handleSpreadsheetFormula($_);
+ # _handleSpreadsheetFormula($_);
_debug("RENDER ROW: FOOTER:rowNr=$rowNr; id=$rowId=$_");
push( @footerRows, $_ );
}
--
KennethLavrsen - 02 Sep 2009
Checked in the quickfix now. And opened
Item1999 to follow up on getting the CALC feature implemented correctly later.
I found this fix urgent. The CALC in header and footer now displays as the resulting CALC which for numbers normally is a "0" and this is fine for most.
Item1999 is non-urgent.
--
KennethLavrsen - 02 Sep 2009