New Foswiki release 2.1.6 is available with important security fixes.
Sourceforge foswiki email lists being discontinued. Subscribe to the new Foswiki announce and discuss lists at MailingLists

Item14000: Wrong row is deleted by EditRowPlugin in full table edit mode.

Priority: Normal
Current State: Closed
Released In: 2.1.1
Target Release: patch
Applies To: Extension
Component: EditRowPlugin
Branches: master Release02x01 Item14033 Item13897 Item14380 Item14537
Reported By: PhilippHoppen
Waiting For:
Last Change By: GeorgeClark
When editing the full table and clicking the "minus", the second-last row is deleted. It is expected that the last row is deleted instead.

the POST request sends erp_row=-1 to the server, where in in sub deleteRowCmd, the row to delete is selected as

    my $row =
        $urps->{erp_row} >= 0
      ? $urps->{erp_row}
      : $this->totalRows() + $urps->{erp_row} -1;
    return unless $this->deleteRow($row);

As 1 is the index of the first row, this selects the second last row. It works fine when removing the -1:

    my $row =
        $urps->{erp_row} >= 0
      ? $urps->{erp_row}
      : $this->totalRows() + $urps->{erp_row};
    return unless $this->deleteRow($row);

-- PhilippHoppen - 01 Mar 2016

Thanks for the fix! This will be picked up in Foswiki 2.1.1.

-- GeorgeClark - 01 Apr 2016
Topic revision: r9 - 31 Jan 2018, GeorgeClark - This page was cached on 12 Mar 2018 - 04:47.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License