Commit f3c35536 authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1558854: Need to allow default numcolumns in lib/view.php



When we upgrade from earlier versions views need to be saved that
expect the numcolumns field to exist before we get round to dropping
it. So the View class needs to be able to define a default value for
it.

behatnotneeded - unable to test upgrades

Change-Id: Ic70add18e814975289a7145e8e91454e3699a234
Signed-off-by: default avatarRobert Lyon <robertl@catalyst.net.nz>
parent 4cb7d7d7
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ class View {
    private $ownerobj;
    private $groupobj;
    private $institutionobj;
    private $numcolumns; // Obsolete - need to leave for upgrade purposes. This can be deleted once we no longer need to support direct upgrades from 15.10 and earlier.
    private $columnsperrow; // assoc array of rows set and get using view_rows_columns db table
    private $numrows;
    private $layout;
@@ -554,6 +555,7 @@ class View {

        // Create the view
        $defaultdata = array(
            'numcolumns'    => 2, // Obsolete - need to leave for upgrade purposes. This can be deleted once we no longer need to support direct upgrades from 15.10 and earlier.
            'numrows'       => 1,
            'columnsperrow' => self::default_columnsperrow(),
            'template'      => 0,