Reviewed: https://reviews.mahara.org/c/mahara/+/13602 Committed: https://git.mahara.org/mahara/mahara/commit/721b89a01e3ac6c516e6660eefc76eac991c3c46 Submitter: "Doris Tam <[email protected]>" Branch: main
commit 721b89a01e3ac6c516e6660eefc76eac991c3c46 Author: Robert Lyon <[email protected]> Date: Tue Jan 10 15:07:06 2023 +1300 Bug 2002364: Make sure ctime is set on block creation Even if a ctime value is supplied we should set it to the time the block is actually created Change-Id: I35bf0c93957f7f024bf5518f395e3fae5fdfd589 Signed-off-by: Robert Lyon <[email protected]> -- You received this bug notification because you are a member of Mahara Contributors, which is subscribed to Mahara. Matching subscriptions: mahara-contributors https://bugs.launchpad.net/bugs/2002364 Title: Copying a group throws error Status in Mahara: Fix Committed Bug description: When you want to copy a group, the following error message is displayed and the copying aborted: [WAR] 0b (lib/errors.php:852) Failed to get a recordset: postgres9 error: [-1: ERROR: null value in column "ctime" violates not-null constraint DETAIL: Failing row contains (48, groupmembers, , b:0;, 12, 1, null, null, null, 2023-01-10 01:43:22).] in EXECUTE("INSERT INTO "block_instance" ("id", "blocktype", "title", "configdata", "view", "row", "mtime") VALUES (?, ?, ?, ?, ?, ?, ?)")Command was: INSERT INTO "block_instance" ("id", "blocktype", "title", "configdata", "view", "row", "mtime") VALUES (?, ?, ?, ?, ?, ?, ?) and values was (id:48,blocktype:groupmembers,title:,configdata:b:0;,view:12,row:1,mtime:2023-01-1001:43:22) Call stack (most recent first): log_message("Failed to get a recordset: postgres9 error: [-1: E...", 8, true, true) at /home/kristina/code/mahara/htdocs/lib/errors.php:89 log_warn("Failed to get a recordset: postgres9 error: [-1: E...") at /home/kristina/code/mahara/htdocs/lib/errors.php:852 SQLException->__construct("Failed to get a recordset: postgres9 error: [-1: E...") at /home/kristina/code/mahara/htdocs/lib/dml.php:1236 insert_record("block_instance", object(stdClass), "id", true) at /home/kristina/code/mahara/htdocs/blocktype/lib.php:2320 BlockInstance->commit() at /home/kristina/code/mahara/htdocs/lib/group.php:3354 group_copy(3, "mygroups") at /home/kristina/code/mahara/htdocs/group/copy.php:44 [WAR] 0b (lib/dml.php:1236) Failed to get a recordset: postgres9 error: [-1: ERROR: null value in column "ctime" violates not-null constraint DETAIL: Failing row contains (48, groupmembers, , b:0;, 12, 1, null, null, null, 2023-01-10 01:43:22).] in EXECUTE("INSERT INTO "block_instance" ("id", "blocktype", "title", "configdata", "view", "row", "mtime") VALUES (?, ?, ?, ?, ?, ?, ?)")Command was: INSERT INTO "block_instance" ("id", "blocktype", "title", "configdata", "view", "row", "mtime") VALUES (?, ?, ?, ?, ?, ?, ?) and values was (id:48,blocktype:groupmembers,title:,configdata:b:0;,view:12,row:1,mtime:2023-01-1001:43:22) Call stack (most recent first): insert_record() at /home/kristina/code/mahara/htdocs/blocktype/lib.php:2320 BlockInstance->commit() at /home/kristina/code/mahara/htdocs/lib/group.php:3354 group_copy() at /home/kristina/code/mahara/htdocs/group/copy.php:44 [WAR] 0b (lib/errors.php:852) Failed to get a recordset: postgres9 error: [-1: ERROR: null value in column "ctime" violates not-null constraint DETAIL: Failing row contains (48, groupmembers, , b:0;, 12, 1, null, null, null, 2023-01-10 01:43:22).] in EXECUTE("INSERT INTO "block_instance" ("id", "blocktype", "title", "configdata", "view", "row", "mtime") VALUES (?, ?, ?, ?, ?, ?, ?)")Command was: INSERT INTO "block_instance" ("id", "blocktype", "title", "configdata", "view", "row", "mtime") VALUES (?, ?, ?, ?, ?, ?, ?) and values was (id:48,blocktype:groupmembers,title:,configdata:b:0;,view:12,row:1,mtime:2023-01-1001:43:22) Call stack (most recent first): log_message("Failed to get a recordset: postgres9 error: [-1: E...", 8, true, true) at /home/kristina/code/mahara/htdocs/lib/errors.php:89 log_warn("Failed to get a recordset: postgres9 error: [-1: E...") at /home/kristina/code/mahara/htdocs/lib/errors.php:852 SQLException->__construct("Failed to get a recordset: postgres9 error: [-1: E...") at /home/kristina/code/mahara/htdocs/lib/dml.php:1236 insert_record("block_instance", object(stdClass), "id", true) at /home/kristina/code/mahara/htdocs/blocktype/lib.php:2320 BlockInstance->commit() at /home/kristina/code/mahara/htdocs/lib/group.php:3354 group_copy(3, "mygroups") at /home/kristina/code/mahara/htdocs/group/copy.php:44 [WAR] 0b (lib/dml.php:1236) Failed to get a recordset: postgres9 error: [-1: ERROR: null value in column "ctime" violates not-null constraint DETAIL: Failing row contains (48, groupmembers, , b:0;, 12, 1, null, null, null, 2023-01-10 01:43:22).] in EXECUTE("INSERT INTO "block_instance" ("id", "blocktype", "title", "configdata", "view", "row", "mtime") VALUES (?, ?, ?, ?, ?, ?, ?)")Command was: INSERT INTO "block_instance" ("id", "blocktype", "title", "configdata", "view", "row", "mtime") VALUES (?, ?, ?, ?, ?, ?, ?) and values was (id:48,blocktype:groupmembers,title:,configdata:b:0;,view:12,row:1,mtime:2023-01-1001:43:22) Call stack (most recent first): insert_record() at /home/kristina/code/mahara/htdocs/blocktype/lib.php:2320 BlockInstance->commit() at /home/kristina/code/mahara/htdocs/lib/group.php:3354 group_copy() at /home/kristina/code/mahara/htdocs/group/copy.php:44 To replicate: 1. As site admin create a group and only give it a title. It's not necessary to change any other group settings. 2. Save the group. Results: - Expected: The group is copied. - Actual: The above error message is displayed. To manage notifications about this bug go to: https://bugs.launchpad.net/mahara/+bug/2002364/+subscriptions _______________________________________________ Mailing list: https://launchpad.net/~mahara-contributors Post to : [email protected] Unsubscribe : https://launchpad.net/~mahara-contributors More help : https://help.launchpad.net/ListHelp

