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

pencil
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 Table.pm 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
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy