Can't edit access to profile after "Logged-in profile access" turned on

Bug #1265696 reported by Jono Mingard on 2014-01-03
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Medium
Robert Lyon

Bug Description

Steps to reproduce:
- Turn off "Logged-in profile access" in Administration -> Configure site -> Site options
- Remove "Logged-in users" from the access list on your profile page
- Turn "Logged-in profile access" back on
- Try to edit access to your profile page

This spews out various errors and prevents you from accessing the page:
[WAR] 25 (lib/adodb/adodb-exceptions.inc.php:43) Array to string conversion
[WAR] 25 (lib/errors.php:736) Failed to get a recordset: postgres7 error: [-1: ERROR: null value in column "ctime" violates not-null constraint] in adodb_throw(INSERT INTO "view_access" ("view", "accesstype", "allowcomments", "approvecomments") VALUES (?, ?, ?, ?), Array)
Command was: INSERT INTO "view_access" ("view", "accesstype", "allowcomments", "approvecomments") VALUES (?, ?, ?, ?) and values was (4,loggedin,0,1)
[WAR] 25 (lib/dml.php:1053) Failed to get a recordset: postgres7 error: [-1: ERROR: null value in column "ctime" violates not-null constraint] in adodb_throw(INSERT INTO "view_access" ("view", "accesstype", "allowcomments", "approvecomments") VALUES (?, ?, ?, ?), Array)
Command was: INSERT INTO "view_access" ("view", "accesstype", "allowcomments", "approvecomments") VALUES (?, ?, ?, ?) and values was (4,loggedin,0,1)

Affects latest master

Robert Lyon (robertl-9) on 2014-01-05
Changed in mahara:
importance: Undecided → Medium
assignee: nobody → Robert Lyon (robertl-9)
milestone: none → 1.9.0
status: New → In Progress
Robert Lyon (robertl-9) wrote :

Have made patch
https://reviews.mahara.org/#/c/2863/

The patch checks to see if a row already exists in the view_access table and if not add the ctime to the object used to ensure that row exists, allowing for proper insertion further down the process chain.

Steven (stevens-q) wrote :

=== Bug #1265696 Can't edit access to profile after "Logged-in profile access" turned on ===

=== Steps to reproduce: ===
- Turn off "Logged-in profile access" in Administration -> Configure site -> Site options -> user settings
- Remove "Logged-in users" from the access list on your profile page
- Turn "Logged-in profile access" back on
- Try to edit access to your profile page

=== Test Results ===
No errors were encountered ✔

Catalyst QA Approved ✔

Reviewed: https://reviews.mahara.org/2863
Committed: http://gitorious.org/mahara/mahara/commit/cb1d3bc8fa9c1168f90d06b92be1fb59d21334f2
Submitter: Aaron Wells (<email address hidden>)
Branch: master

commit cb1d3bc8fa9c1168f90d06b92be1fb59d21334f2
Author: Robert Lyon <email address hidden>
Date: Mon Jan 6 08:30:27 2014 +1300

Add ctime if needing to insert view_access row for profile (bug 1265696)

When forcing the 'Logged-in profile access' for profile page and the
view_access row does not exist we need to set the ctime.

See bug for test scenario.

Change-Id: I050c4091780637d9819a8422b79231b256097951
Signed-off-by: Robert Lyon <email address hidden>

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

Other bug subscribers