Institution/group ownership of custom flexible layouts
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 : | #1 |
Changed in mahara: | |
status: | Confirmed → In Progress |
assignee: | nobody → Robert Lyon (robertl-9) |
Changed in mahara: | |
status: | In Progress → Fix Committed |
Patch for "1.8_STABLE" branch: https:/
Mahara Bot (dev-mahara) wrote : | #3 |
Patch for "1.8_STABLE" branch: https:/
Mahara Bot (dev-mahara) wrote : | #4 |
Patch for "1.8_STABLE" branch: https:/
Mahara Bot (dev-mahara) wrote : | #5 |
Patch for "1.8_STABLE" branch: https:/
Mahara Bot (dev-mahara) wrote : | #8 |
Patch for "1.8_STABLE" branch: https:/
Mahara Bot (dev-mahara) wrote : | #6 |
Patch for "1.8_STABLE" branch: https:/
Mahara Bot (dev-mahara) wrote : | #7 |
Patch for "1.8_STABLE" branch: https:/
Mahara Bot (dev-mahara) wrote : | #9 |
Patch for "1.8_STABLE" branch: https:/
Reviewed: https:/
Committed: http://
Submitter: Aaron Wells (<email address hidden>)
Branch: 1.8_STABLE
commit 40dbbdffc465499
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
when reading from and writing to usr_custom_layout table
Change-Id: I27d83d9a7e76f2
Signed-off-by: Mike Kelly <email address hidden>
Mahara Bot (dev-mahara) wrote : | #11 |
Reviewed: https:/
Committed: http://
Submitter: Aaron Wells (<email address hidden>)
Branch: 1.8_STABLE
commit 0f026df2448784e
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
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: Id42ebcc543d29e
Signed-off-by: Mike Kelly <email address hidden>
Mahara Bot (dev-mahara) wrote : | #12 |
Reviewed: https:/
Committed: http://
Submitter: Aaron Wells (<email address hidden>)
Branch: 1.8_STABLE
commit ce2a66e87e1ff2b
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.
Change-Id: Ief7c8c5d2aef45
Signed-off-by: Mike Kelly <email address hidden>
Mahara Bot (dev-mahara) wrote : | #13 |
Reviewed: https:/
Committed: http://
Submitter: Aaron Wells (<email address hidden>)
Branch: 1.8_STABLE
commit 97fcee20428d8de
Author: Mike Kelly <email address hidden>
Date: Tue Nov 19 11:35:49 2013 +0000
Upgrade usr_custom_layout table and fix problem entries
Change-Id: I1daef151b72a04
Signed-off-by: Mike Kelly <email address hidden>
Mahara Bot (dev-mahara) wrote : | #14 |
Reviewed: https:/
Committed: http://
Submitter: Aaron Wells (<email address hidden>)
Branch: 1.8_STABLE
commit 1ae491b23aa5383
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
Change-Id: If705906005d6c6
Signed-off-by: Mike Kelly <email address hidden>
Mahara Bot (dev-mahara) wrote : | #15 |
Reviewed: https:/
Committed: http://
Submitter: Aaron Wells (<email address hidden>)
Branch: 1.8_STABLE
commit 09b2f5ba730d4d0
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: If8faa8be50f8cd
Signed-off-by: Mike Kelly <email address hidden>
Mahara Bot (dev-mahara) wrote : | #16 |
Reviewed: https:/
Committed: http://
Submitter: Aaron Wells (<email address hidden>)
Branch: 1.8_STABLE
commit 816d1409296cca1
Author: Mike Kelly <email address hidden>
Date: Thu Dec 5 17:07:02 2013 +0000
Check for institutional ownership of view
when setting or getting custom layout
Change-Id: Ic7cfb9e1fd0eaf
Signed-off-by: Mike Kelly <email address hidden>
Mahara Bot (dev-mahara) wrote : | #17 |
Reviewed: https:/
Committed: http://
Submitter: Aaron Wells (<email address hidden>)
Branch: 1.8_STABLE
commit 415308d2fbf07d2
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
Change-Id: If065430bfd50b9
Signed-off-by: Mike Kelly <email address hidden>
Aaron Wells (u-aaronw) wrote : | #18 |
Update: by backporting this to 1.8 without checking that it was okay to run this update multiple times, I raised another bug: https:/
Gordon McLeod (g-mcleod1) wrote : | #19 |
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 : | #20 |
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 : | #21 |
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 : | #22 |
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
Changed in mahara: | |
status: | Fix Committed → Fix Released |
no longer affects: | mahara/1.9 |
Mike Kelly has submitted a number of patches for this starting with: /reviews. mahara. org/#/c/ 2712/
https:/