Unable to delete a group

Bug #1995527 reported by Robert Lyon
18
This bug affects 3 people
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 I try to delete a group when the submissions plugin is not installed I get the following message:
ERROR: relation "module_submissions" does not exist

This module may not be installed if upgrading from older system.

Need to add an if_plugin_installed() check similar to is_plugin_active() so we can check if a plugin has been installed at some point even if it's not active currently - because when deleting a group we want to delete the info for the plugin even if it's not active.

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

To test this you would need to have a site installed before the submissions plugin existed

1) Install Mahara 20.04_STABLE
2) Upgrade to main
3) Check the extenstions -> plugins page the 'module' submissions should NOT be installed
4) Create a group
5) Delete the group

Expected result:

The group is deleted

Actual result:

There is an SQL error and the group doesn't delete

Changed in mahara:
importance: Undecided → High
status: New → In Progress
Revision history for this message
Klaus Steitz (klaus-steitz) wrote :

We are affected too. It also concerns deletion of pages. We got a "Table 'mahara.module_submissions' doesn't exist" error:
[WAR] 11 (lib/errors.php:853) Failed to get a recordset: mysqli error: [1146: Table 'mahara.module_submissions' doesn't exist] in EXECUTE("SELECT "id" FROM "module_submissions" WHERE "portfolioelementtype" = ? AND "portfolioelementid" = ? ")Command was: SELECT "id" FROM "module_submissions" WHERE "portfolioelementtype" = ? AND "portfolioelementid" = ? and values was (0:view,1:75523)

see also https://mahara.org/interaction/forum/topic.php?id=9244

Thanks for that fix, works fine for us!

kind regards
Klaus

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

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

commit eded804f49f537bb3aa1f91be8f858b5f1c8386b
Author: Robert Lyon <email address hidden>
Date: Thu Nov 3 09:36:24 2022 +1300

Bug 1995527: Need to check module is installed before deleting content

When deleting a page or collection

Which can happen when deleting
- a group
- a user

etc

Change-Id: I25889d71295bd3741c8479beb69c4746541a8dfd
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/+/13640

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

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

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

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

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

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

commit b1d5fe0847987394eb94572d18eaa1d52e54593c
Author: Robert Lyon <email address hidden>
Date: Thu Nov 3 09:36:24 2022 +1300

Bug 1995527: Need to check module is installed before deleting content

When deleting a page or collection

Which can happen when deleting
- a group
- a user

etc

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

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

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

commit 42bec0a01fef51efc3b3dbe44ff9a651f28f650a
Author: Robert Lyon <email address hidden>
Date: Thu Nov 3 09:36:24 2022 +1300

Bug 1995527: Need to check module is installed before deleting content

When deleting a page or collection

Which can happen when deleting
- a group
- a user

etc

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

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

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

commit 9553335279b076b85a908e0e0fa5fe0de91cfe1a
Author: Robert Lyon <email address hidden>
Date: Thu Nov 3 09:36:24 2022 +1300

Bug 1995527: Need to check module is installed before deleting content

When deleting a page or collection

Which can happen when deleting
- a group
- a user

etc

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

Robert Lyon (robertl-9)
Changed in mahara:
milestone: 22.10.1 → 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.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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