errors when copying a page after editing column widths manually

Bug #1880803 reported by Cecilia Vela Gurovic
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Cecilia Vela Gurovic
19.04
Fix Released
High
Unassigned
19.10
Fix Released
High
Unassigned
20.04
Fix Released
High
Unassigned
20.10
Fix Released
High
Cecilia Vela Gurovic

Bug Description

For any version newer than 19.04, follow the steps below and then upgrade. It will display the same errors when trying to copy or translate the view with the old layout.

On 19.04

to replicate:
- go to User menu-> Preferences -> Settigns
- set 'Show controls to add and remove columns when editing a page' to yes and save
- create a view
- set a custom layout e.g. 3 rows with 3 columns and 1 row with 1 column
- play with the column changing the widths
- display the page and make a copy and try to edit the view

the following errors are displayed

[WAR] 28 (lib/view.php:2994) Undefined offset: 4
Call stack (most recent first):

    log_message("Undefined offset: 4", 8, true, true, "/home/ceciliavg/maharacode/mahara/htdocs/lib/view....", 2994) at /home/ceciliavg/maharacode/mahara/htdocs/lib/errors.php:520
    error(8, "Undefined offset: 4", "/home/ceciliavg/maharacode/mahara/htdocs/lib/view....", 2994, array(size 4)) at /home/ceciliavg/maharacode/mahara/htdocs/lib/view.php:2994
    View->removerow(array(size 2)) at /home/ceciliavg/maharacode/mahara/htdocs/view/editlayout.php:701
    set_view_layout(object(Pieform), array(size 16)) at /home/ceciliavg/maharacode/mahara/htdocs/view/editlayout.php:643
    settings_submit(object(Pieform), array(size 16)) at /home/ceciliavg/maharacode/mahara/htdocs/lib/pieforms/pieform.php:544
    Pieform->__construct(array(size 5)) at /home/ceciliavg/maharacode/mahara/htdocs/lib/pieforms/pieform.php:166
    Pieform::process(array(size 5)) at /home/ceciliavg/maharacode/mahara/htdocs/lib/mahara.php:5445
    pieform(array(size 5)) at /home/ceciliavg/maharacode/mahara/htdocs/view/editlayout.php:222
    create_settings_pieform() at /home/ceciliavg/maharacode/mahara/htdocs/view/editlayout.php:106

[WAR] 28 (lib/view.php:2994) Undefined offset: 3
Call stack (most recent first):

    log_message("Undefined offset: 3", 8, true, true, "/home/ceciliavg/maharacode/mahara/htdocs/lib/view....", 2994) at /home/ceciliavg/maharacode/mahara/htdocs/lib/errors.php:520
    error(8, "Undefined offset: 3", "/home/ceciliavg/maharacode/mahara/htdocs/lib/view....", 2994, array(size 4)) at /home/ceciliavg/maharacode/mahara/htdocs/lib/view.php:2994
    View->removerow(array(size 2)) at /home/ceciliavg/maharacode/mahara/htdocs/view/editlayout.php:701
    set_view_layout(object(Pieform), array(size 16)) at /home/ceciliavg/maharacode/mahara/htdocs/view/editlayout.php:643
    settings_submit(object(Pieform), array(size 16)) at /home/ceciliavg/maharacode/mahara/htdocs/lib/pieforms/pieform.php:544
    Pieform->__construct(array(size 5)) at /home/ceciliavg/maharacode/mahara/htdocs/lib/pieforms/pieform.php:166
    Pieform::process(array(size 5)) at /home/ceciliavg/maharacode/mahara/htdocs/lib/mahara.php:5445
    pieform(array(size 5)) at /home/ceciliavg/maharacode/mahara/htdocs/view/editlayout.php:222
    create_settings_pieform() at /home/ceciliavg/maharacode/mahara/htdocs/view/editlayout.php:106

[WAR] 28 (lib/view.php:2994) Undefined offset: 2
Call stack (most recent first):

    log_message("Undefined offset: 2", 8, true, true, "/home/ceciliavg/maharacode/mahara/htdocs/lib/view....", 2994) at /home/ceciliavg/maharacode/mahara/htdocs/lib/errors.php:520
    error(8, "Undefined offset: 2", "/home/ceciliavg/maharacode/mahara/htdocs/lib/view....", 2994, array(size 4)) at /home/ceciliavg/maharacode/mahara/htdocs/lib/view.php:2994
    View->removerow(array(size 2)) at /home/ceciliavg/maharacode/mahara/htdocs/view/editlayout.php:701
    set_view_layout(object(Pieform), array(size 16)) at /home/ceciliavg/maharacode/mahara/htdocs/view/editlayout.php:643
    settings_submit(object(Pieform), array(size 16)) at /home/ceciliavg/maharacode/mahara/htdocs/lib/pieforms/pieform.php:544
    Pieform->__construct(array(size 5)) at /home/ceciliavg/maharacode/mahara/htdocs/lib/pieforms/pieform.php:166
    Pieform::process(array(size 5)) at /home/ceciliavg/maharacode/mahara/htdocs/lib/mahara.php:5445
    pieform(array(size 5)) at /home/ceciliavg/maharacode/mahara/htdocs/view/editlayout.php:222
    create_settings_pieform() at /home/ceciliavg/maharacode/mahara/htdocs/view/editlayout.php:106

Changed in mahara:
assignee: nobody → Cecilia Vela Gurovic (ceciliavg)
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "19.10_STABLE" branch: https://reviews.mahara.org/10991

description: updated
Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "master" branch: https://reviews.mahara.org/10992

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "19.04_STABLE" branch: https://reviews.mahara.org/10993

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/10993
Committed: https://git.mahara.org/mahara/mahara/commit/794a53187e1fdd9768a10a2b632e879f435e9fda
Submitter: Robert Lyon (<email address hidden>)
Branch: 19.04_STABLE

commit 794a53187e1fdd9768a10a2b632e879f435e9fda
Author: Cecilia Vela Gurovic <email address hidden>
Date: Fri May 29 11:55:51 2020 +1200

Bug 1880803: update view_rows_columns when copying

we need to replace the method we use for checking if the
view_rows_columns records need to be updated or not.
When copying a page this is not saved correctly.

This table, related to old view layouts, contains
the number of columns for each row.

If the view layout has been defined with manually
edited columns, then it won't have a layout id but
it will have the view_rows_columns records up to date

behatnotneeded

Change-Id: Ibebd7a715943315e50158404215046c0568c9626

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/10992
Committed: https://git.mahara.org/mahara/mahara/commit/bbeadbd29388385d9100abbb050ff5ac5bfcc671
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit bbeadbd29388385d9100abbb050ff5ac5bfcc671
Author: Cecilia Vela Gurovic <email address hidden>
Date: Fri May 29 10:55:00 2020 +1200

Bug 1880803: copying a page after editing column widths manually

there's a different fix for 19.04 because we change some of
the code when implementing the gridstack layout

behatnotneeded

Change-Id: Ie809449c41b01ab7fc1adc3a8b7fd1118f30a896

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "20.04_STABLE" branch: https://reviews.mahara.org/11000

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/10991
Committed: https://git.mahara.org/mahara/mahara/commit/b32794f6eceebe98911bb7804903bf945c16424b
Submitter: Robert Lyon (<email address hidden>)
Branch: 19.10_STABLE

commit b32794f6eceebe98911bb7804903bf945c16424b
Author: Cecilia Vela Gurovic <email address hidden>
Date: Fri May 29 10:55:00 2020 +1200

Bug 1880803: copying a page after editing column widths manually

there's a different fix for 19.04 because we change some of
the code when implementing the gridstack layout

behatnotneeded

Change-Id: Ie809449c41b01ab7fc1adc3a8b7fd1118f30a896

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/11000
Committed: https://git.mahara.org/mahara/mahara/commit/51db06882401f084bab430ea24a27c629077655f
Submitter: Robert Lyon (<email address hidden>)
Branch: 20.04_STABLE

commit 51db06882401f084bab430ea24a27c629077655f
Author: Cecilia Vela Gurovic <email address hidden>
Date: Fri May 29 10:55:00 2020 +1200

Bug 1880803: copying a page after editing column widths manually

there's a different fix for 19.04 because we change some of
the code when implementing the gridstack layout

behatnotneeded

Change-Id: Ie809449c41b01ab7fc1adc3a8b7fd1118f30a896
(cherry picked from commit bbeadbd29388385d9100abbb050ff5ac5bfcc671)

Robert Lyon (robertl-9)
Changed in mahara:
milestone: 20.10.0 → none
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.