Block order numbers out of sync with number of blocks in a cell
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| Mahara |
High
|
Robert Lyon | ||
| 1.10 |
High
|
Unassigned | ||
| 15.04 |
High
|
Unassigned | ||
| 15.10 |
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;
Robert Lyon (robertl-9) wrote : | #1 |
Changed in mahara: | |
status: | New → In Progress |
importance: | Undecided → High |
assignee: | nobody → Robert Lyon (robertl-9) |
milestone: | none → 16.04.0 |
Patch for "master" branch: https:/
Reviewed: https:/
Committed: https:/
Submitter: Robert Lyon (<email address hidden>)
Branch: master
commit 7fbc667b2b6d583
Author: Robert Lyon <email address hidden>
Date: Tue Dec 22 10:43:57 2015 +1300
Bug 1528351: Fixing block order drift in database
Due to a mistake in how blocks were ordered in the system
behatnotneeded - existing tests should be ok
Change-Id: Iac857c85d60e59
Signed-off-by: Robert Lyon <email address hidden>
Changed in mahara: | |
status: | In Progress → Fix Committed |
Patch for "15.10_STABLE" branch: https:/
Reviewed: https:/
Committed: https:/
Submitter: Robert Lyon (<email address hidden>)
Branch: 15.10_STABLE
commit bad81b1fc995fe7
Author: Robert Lyon <email address hidden>
Date: Tue Dec 22 10:43:57 2015 +1300
Bug 1528351: Fixing block order drift in database
Due to a mistake in how blocks were ordered in the system
behatnotneeded - existing tests should be ok
Change-Id: Iac857c85d60e59
Signed-off-by: Robert Lyon <email address hidden>
Patch for "15.04_STABLE" branch: https:/
Reviewed: https:/
Committed: https:/
Submitter: Robert Lyon (<email address hidden>)
Branch: 15.04_STABLE
commit 4251b9834fe1325
Author: Robert Lyon <email address hidden>
Date: Tue Dec 22 10:43:57 2015 +1300
Bug 1528351: Fixing block order drift in database
Due to a mistake in how blocks were ordered in the system
behatnotneeded - existing tests should be ok
Change-Id: Iac857c85d60e59
Signed-off-by: Robert Lyon <email address hidden>
Patch for "1.10_STABLE" branch: https:/
Reviewed: https:/
Committed: https:/
Submitter: Robert Lyon (<email address hidden>)
Branch: 1.10_STABLE
commit 142faacc5fcef09
Author: Robert Lyon <email address hidden>
Date: Tue Dec 22 10:43:57 2015 +1300
Bug 1528351: Fixing block order drift in database
Due to a mistake in how blocks were ordered in the system
behatnotneeded - existing tests should be ok
Change-Id: Iac857c85d60e59
Signed-off-by: Robert Lyon <email address hidden>
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