Duplicate key error on block edit page in Postgres

Bug #1733938 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Unassigned

Bug Description

It is possible to get this error:

Failed to get a recordset: postgres8 error: [-5: ERROR: duplicate key value violates unique constraint "blocinst_vierowcolord_uk" DETAIL: Key (view, "row", "column", "order")=(16, 1, 1, 1) already exists.] in EXECUTE("INSERT INTO "block_instance" ("id", "blocktype", "title", "configdata", "view", "column", "order", "row") VALUES (?, ?, ?, ?, ?, ?, ?, ?)")Command was: INSERT INTO "block_instance" ("id", "blocktype", "title", "configdata", "view", "column", "order", "row") VALUES (?, ?, ?, ?, ?, ?, ?, ?) and values was (id:8261,blocktype:textbox,title:Note,configdata:a:0:{},view:16,column:1,order:1,row:1)

To reproduce:
1. Create a new page
2. Click on the Note block
3. Do not click on Add nor on Cancel, but press ESC key (because you just realised that you have selected the wrong text block)
4. Click on the Text block
5. Click on the Add button

The problem here is the using of 'ESC' key is not cleaning up info about old block, so is trying to save the old and new block with same block position

Revision history for this message
Robert Lyon (robertl-9) wrote :

In MySQL it behaves slightly differently and tries to display both blocks causing the config form to be confused

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/8299

Changed in mahara:
milestone: none → 18.04.0
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/8299
Committed: https://git.mahara.org/mahara/mahara/commit/8e48d4c84f4358396bafa0cbe65283c997582879
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 8e48d4c84f4358396bafa0cbe65283c997582879
Author: Robert Lyon <email address hidden>
Date: Thu Nov 23 09:01:28 2017 +1300

Bug 1733938: Allow 'ESC' key to cancel adding of a block

When on the 'add block' popup

behatnotneeded

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

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/8346

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

The last review from 13 December was abandonded.

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.