Institution/group ownership of custom flexible layouts

Bug #1266317 reported by Robert Lyon on 2014-01-06
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Mahara
High
Robert Lyon
1.8
High
Aaron Wells

Bug Description

I came across a nasty bug in the mahara custom layouts feature.

If a user saves a custom layout from within a group, the view owner is null, so usr in the usr_custom_layout table is set to be 0.
This means that the saved custom layout becomes available to all users, so the advanced layout options area gets cluttered quite quickly.

Robert Lyon (robertl-9) wrote :

Mike Kelly has submitted a number of patches for this starting with:
https://reviews.mahara.org/#/c/2712/

Robert Lyon (robertl-9) on 2014-01-06
Changed in mahara:
status: Confirmed → In Progress
assignee: nobody → Robert Lyon (robertl-9)
Robert Lyon (robertl-9) on 2014-01-08
Changed in mahara:
status: In Progress → Fix Committed
Mahara Bot (dev-mahara) wrote :

Patch for "1.8_STABLE" branch: https://reviews.mahara.org/3071

Mahara Bot (dev-mahara) wrote :

Patch for "1.8_STABLE" branch: https://reviews.mahara.org/3072

Mahara Bot (dev-mahara) wrote :

Patch for "1.8_STABLE" branch: https://reviews.mahara.org/3074

Mahara Bot (dev-mahara) wrote :

Patch for "1.8_STABLE" branch: https://reviews.mahara.org/3073

Mahara Bot (dev-mahara) wrote :

Patch for "1.8_STABLE" branch: https://reviews.mahara.org/3077

Mahara Bot (dev-mahara) wrote :

Patch for "1.8_STABLE" branch: https://reviews.mahara.org/3075

Mahara Bot (dev-mahara) wrote :

Patch for "1.8_STABLE" branch: https://reviews.mahara.org/3076

Reviewed: https://reviews.mahara.org/3071
Committed: http://gitorious.org/mahara/mahara/commit/40dbbdffc465499f9cd96cdb17089cc310a2590f
Submitter: Aaron Wells (<email address hidden>)
Branch: 1.8_STABLE

commit 40dbbdffc465499f9cd96cdb17089cc310a2590f
Author: Mike Kelly <email address hidden>
Date: Tue Nov 19 15:06:36 2013 +0000

Check for group, site and institution ownership of custom layouts

Bug #1266317

when reading from and writing to usr_custom_layout table

Change-Id: I27d83d9a7e76f250cfc903198567d2341168cacc
Signed-off-by: Mike Kelly <email address hidden>

Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/3070
Committed: http://gitorious.org/mahara/mahara/commit/0f026df2448784e1d2db41359de98b37dccfe243
Submitter: Aaron Wells (<email address hidden>)
Branch: 1.8_STABLE

commit 0f026df2448784e1d2db41359de98b37dccfe243
Author: Mike Kelly <email address hidden>
Date: Tue Nov 19 11:24:11 2013 +0000

Restructure usr_custom_layout table to take groups into account

Bug #1266317

Group pages, site and institution pages were set as having usr = 0 in
usr_custom_layout because the view owner is null.

Fix by adding group column to table, foreign keyed to group table.

usr column and group column have to be changed to allow null values, and
to have null as default values.

When saving a custom layout, check context, then set usr and group
values accordingly.
e.g.
usr = 5, group = null
usr = null, group = 321
In the case of site and institution pages:
usr = null, group = null

Change-Id: Id42ebcc543d29ee2455aef73227b57c569171385
Signed-off-by: Mike Kelly <email address hidden>

Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/3072
Committed: http://gitorious.org/mahara/mahara/commit/ce2a66e87e1ff2bab1ef8f0dfdf51b138ab2982a
Submitter: Aaron Wells (<email address hidden>)
Branch: 1.8_STABLE

commit ce2a66e87e1ff2bab1ef8f0dfdf51b138ab2982a
Author: Mike Kelly <email address hidden>
Date: Tue Nov 19 11:27:53 2013 +0000

Copy the custom layout where required when copying a view.

Bug #1266317

Change-Id: Ief7c8c5d2aef455d61e78feb5d3c7571d517c830
Signed-off-by: Mike Kelly <email address hidden>

Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/3073
Committed: http://gitorious.org/mahara/mahara/commit/97fcee20428d8de7df62c5d9483ec92d3be4b447
Submitter: Aaron Wells (<email address hidden>)
Branch: 1.8_STABLE

commit 97fcee20428d8de7df62c5d9483ec92d3be4b447
Author: Mike Kelly <email address hidden>
Date: Tue Nov 19 11:35:49 2013 +0000

Upgrade usr_custom_layout table and fix problem entries

Bug 1266317

Change-Id: I1daef151b72a04469b8e78ebd0a487639b9843c1
Signed-off-by: Mike Kelly <email address hidden>

Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/3074
Committed: http://gitorious.org/mahara/mahara/commit/1ae491b23aa5383e356894e7252d414bf8a01417
Submitter: Aaron Wells (<email address hidden>)
Branch: 1.8_STABLE

commit 1ae491b23aa5383e356894e7252d414bf8a01417
Author: Mike Kelly <email address hidden>
Date: Tue Nov 19 11:14:13 2013 +0000

Bump version number to force update to usr_custom_layout table

Bug #1266317

Change-Id: If705906005d6c6490d9a0a3c1e41d959a8d225fe
Signed-off-by: Mike Kelly <email address hidden>

Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/3075
Committed: http://gitorious.org/mahara/mahara/commit/09b2f5ba730d4d03950c713c1baaf1cb3174cde2
Submitter: Aaron Wells (<email address hidden>)
Branch: 1.8_STABLE

commit 09b2f5ba730d4d03950c713c1baaf1cb3174cde2
Author: Mike Kelly <email address hidden>
Date: Wed Dec 4 16:20:44 2013 +0000

Add institution field into usr_custom_layout table (Bug #1266317)

Fix references to layout owner in upgrade routine
Check for institutional ownership of layouts when upgrading
(Site page layouts are saved with ownership by current institution, as
the institution value is already set in a site view)

Change-Id: If8faa8be50f8cdcb9fc32427134115bc5becc296
Signed-off-by: Mike Kelly <email address hidden>

Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/3076
Committed: http://gitorious.org/mahara/mahara/commit/816d1409296cca1aeb0cdc3fe0da4f4d06d426a6
Submitter: Aaron Wells (<email address hidden>)
Branch: 1.8_STABLE

commit 816d1409296cca1aeb0cdc3fe0da4f4d06d426a6
Author: Mike Kelly <email address hidden>
Date: Thu Dec 5 17:07:02 2013 +0000

Check for institutional ownership of view

Bug #1266317

when setting or getting custom layout

Change-Id: Ic7cfb9e1fd0eaf520b3500ee570ffb4ed643a490
Signed-off-by: Mike Kelly <email address hidden>

Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/3077
Committed: http://gitorious.org/mahara/mahara/commit/415308d2fbf07d2b8016f8c2843b30f1ac445f2f
Submitter: Aaron Wells (<email address hidden>)
Branch: 1.8_STABLE

commit 415308d2fbf07d2b8016f8c2843b30f1ac445f2f
Author: Mike Kelly <email address hidden>
Date: Wed Dec 4 16:04:14 2013 +0000

Check for institutional ownership of custom layout when importing LEAP2A

Bug #1266317

Change-Id: If065430bfd50b94597788c0ede91303cd1b476eb
Signed-off-by: Mike Kelly <email address hidden>

Aaron Wells (u-aaronw) wrote :

Update: by backporting this to 1.8 without checking that it was okay to run this update multiple times, I raised another bug: https://bugs.launchpad.net/mahara/+bug/1288490

Gordon McLeod (g-mcleod1) wrote :

Hi,
Just came across related issue on Mahara.org - I was updating a page created by another MacHara group admin (joint admin of the group) to incorporate some new artefacts and tried to update with a custom layout so that the resources would display better (top row 4 columns, bottom row 2 columns).
Error given was: Failed to get a recordset: postgres7 error: [-1: ERROR: null value in column "usr" violates not-null constraint] in adodb_throw(INSERT INTO "usr_custom_layout" ("layout") VALUES (?), Array) Command was: INSERT INTO "usr_custom_layout" ("layout") VALUES (?) and values was (43)
Regards, Gordon.

Robert Lyon (robertl-9) wrote :

Hmm, by looking at the db table on mahara.org it doesn't look like the fix has made it to mahara.org yet.

Gordon McLeod (g-mcleod1) wrote :

Hi,
Is there a timeframe for the fix being updated on Mahara.org?
Also - will this patch be core code in latest 1.8 releases?
Thanks, Gordon.

Robert Lyon (robertl-9) wrote :

Hi Gordon,

The fix will be part of the 1.8.2 release - which should be out by the end of the week.
This fixes a number of issues with flexible layouts in regards to institution/group pages.

Once the 1.8.2 release is out we will try and get Mahara.org updated to using version 1.8.2 asap

Cheers

Robert

Robert Lyon (robertl-9) on 2014-04-22
Changed in mahara:
status: Fix Committed → Fix Released
no longer affects: mahara/1.9
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers