Issue with upgrade and setting the blocktype_installed_viewtypes values correctly

Bug #2006637 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
21.10
Fix Released
High
Unassigned
22.04
Fix Released
High
Unassigned
22.10
Fix Released
High
Unassigned
23.04
Fix Released
High
Unassigned

Bug Description

When we add a new view type we update the blocktype_installed_viewtype table to know what blocks can be used on this new view type.

But if we have an upgrade path where we add two new view types in one upgrade session then the information is not correct from Blocktype::get_viewtypes() because it is set to be static.

We need it to ignore this static-ness on upgrade.

To test:

Install a 20.04_STABLE site
Upgrade to main
Run the following command in database:
select * from blocktype_installed_viewtype where viewtype = 'activity' order by blocktype;

Should see:
29 (or 30) rows including 'placeholder' and 'image' blocktypes

Actually see:

21 (or 22) rows and 'placeholder' and 'image' blocktypes are missing

Robert Lyon (robertl-9)
Changed in mahara:
milestone: none → 23.04.0
importance: Undecided → High
status: New → In Progress
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/c/mahara/+/13740
Committed: https://git.mahara.org/mahara/mahara/commit/eb7abacbcbfa906e9662fd5cb7cfbc881c005973
Submitter: "Robert Lyon <email address hidden>"
Branch: main

commit eb7abacbcbfa906e9662fd5cb7cfbc881c005973
Author: Robert Lyon <email address hidden>
Date: Thu Feb 9 11:14:32 2023 +1300

Bug 2006637: Problem with populating blocktype_installed_viewtype table

For Blocktype::get_viewtypes() the list it returns is static
so if there are more than one call to it during an upgrade it doesn't
pick up any new viewtypes added after the first call.

In upgrade we need it to not be static

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

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

Patch for "22.10_DEV" branch: https://reviews.mahara.org/c/mahara/+/13760

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "22.04_DEV" branch: https://reviews.mahara.org/c/mahara/+/13761

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "21.10_DEV" branch: https://reviews.mahara.org/c/mahara/+/13762

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/c/mahara/+/13761
Committed: https://git.mahara.org/mahara/mahara/commit/c12a1f302490e2993937abe7dbb408f9ddb34407
Submitter: "Robert Lyon <email address hidden>"
Branch: 22.04_DEV

commit c12a1f302490e2993937abe7dbb408f9ddb34407
Author: Robert Lyon <email address hidden>
Date: Thu Feb 9 11:14:32 2023 +1300

Bug 2006637: Problem with populating blocktype_installed_viewtype table

For Blocktype::get_viewtypes() the list it returns is static
so if there are more than one call to it during an upgrade it doesn't
pick up any new viewtypes added after the first call.

In upgrade we need it to not be static

Change-Id: I023b0488929138a597a5a1ad058c2c344e23649f
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit eb7abacbcbfa906e9662fd5cb7cfbc881c005973)

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/c/mahara/+/13762
Committed: https://git.mahara.org/mahara/mahara/commit/464e7303a7e77dbe482a6012a7c4106ddd6a4b15
Submitter: "Robert Lyon <email address hidden>"
Branch: 21.10_DEV

commit 464e7303a7e77dbe482a6012a7c4106ddd6a4b15
Author: Robert Lyon <email address hidden>
Date: Thu Feb 9 11:14:32 2023 +1300

Bug 2006637: Problem with populating blocktype_installed_viewtype table

For Blocktype::get_viewtypes() the list it returns is static
so if there are more than one call to it during an upgrade it doesn't
pick up any new viewtypes added after the first call.

In upgrade we need it to not be static

Change-Id: I023b0488929138a597a5a1ad058c2c344e23649f
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit eb7abacbcbfa906e9662fd5cb7cfbc881c005973)

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/c/mahara/+/13760
Committed: https://git.mahara.org/mahara/mahara/commit/103f1efd5c0aa713b42f0471960facf68378276f
Submitter: "Robert Lyon <email address hidden>"
Branch: 22.10_DEV

commit 103f1efd5c0aa713b42f0471960facf68378276f
Author: Robert Lyon <email address hidden>
Date: Thu Feb 9 11:14:32 2023 +1300

Bug 2006637: Problem with populating blocktype_installed_viewtype table

For Blocktype::get_viewtypes() the list it returns is static
so if there are more than one call to it during an upgrade it doesn't
pick up any new viewtypes added after the first call.

In upgrade we need it to not be static

Change-Id: I023b0488929138a597a5a1ad058c2c344e23649f
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit eb7abacbcbfa906e9662fd5cb7cfbc881c005973)

Robert Lyon (robertl-9)
Changed in mahara:
milestone: 23.04.0 → none
Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
no longer affects: mahara
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.