Block order numbers out of sync with number of blocks in a cell
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
High
|
Robert Lyon | ||
1.10 |
Fix Released
|
High
|
Unassigned | ||
15.04 |
Fix Released
|
High
|
Unassigned | ||
15.10 |
Fix Released
|
High
|
Unassigned |
Bug Description
Due to Bug #1523719 there can exist a mismatch problem between the count of blocks in a page cell and the maximum order number of said blocks, eg you can have either a first block not being at order position 1 or have gaps in order rank, eg 1,2,4 etc, like this:
id | view | row | column | order | maxorder | countorder
-------
10537 | 2754 | 1 | 4 | 3 | 3 | 1
22486 | 6616 | 1 | 2 | 1 | 4 | 3
22487 | 6616 | 1 | 2 | 2 | 4 | 3
22490 | 6616 | 1 | 2 | 4 | 4 | 3
We need a sql query to find these problems and have an update to fix the problem areas in the database.
Here is a query to find the problem cells:
SELECT b.id, b.view, b.row, b.column, b.order,
(SELECT view AS sview, "row" AS srow, "column" AS scol, COUNT("order") AS countorder, MAX("order") AS maxorder FROM block_instance GROUP BY view, "row", "column") AS myview ON myview.sview = b.VIEW AND myview.srow = b.row AND myview.scol = b.column
WHERE maxorder != countorder
ORDER BY b.view, b.row, b.column, b.order;
Changed in mahara: | |
status: | In Progress → Fix Committed |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
Marking this as high as it's a missing part of the fix for Bug 1523719, which has already been merged