← Back to team overview

mahara-contributors team mailing list archive

[Bug 1928999] A change has been merged

 

Reviewed:  https://reviews.mahara.org/11797
Committed: https://git.mahara.org/mahara/mahara/commit/8a99e6b68ad82eb14c6f2ea955dc733ce957354b
Submitter: Robert Lyon (robertl@xxxxxxxxxxxxxxx)
Branch:    20.04_STABLE

commit 8a99e6b68ad82eb14c6f2ea955dc733ce957354b
Author: Ghada El-Zoghbi <ghada@xxxxxxxxxxxxxxx>
Date:   Thu May 20 12:18:07 2021 +1000

Bug #1928999: Validate LTI table exists before deleting

While deleting an external app, we need to first check
that the LTI table exist.

behatnotneeded

Change-Id: I5702152afbe480badbc0e1ca65ec98afd9eed5a6
(cherry picked from commit fb04b1643c4234f4887bd891a48081af3f366258)

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: mahara-contributors
https://bugs.launchpad.net/bugs/1928999

Title:
  Error while deleting an External App if LTI plugin was never installed

Status in Mahara:
  Fix Committed
Status in Mahara 20.04 series:
  Fix Committed
Status in Mahara 20.10 series:
  Fix Committed
Status in Mahara 21.04 series:
  Fix Committed
Status in Mahara 21.10 series:
  Fix Committed

Bug description:
  Mahara: 20.10.1
  OS: Linux 18.04
  DB: Postgres
  Browser: any

  
  An error is generated when a user deletes an External App if the LTI plugin was never installed on the site.

  To replicate:
  - Create a new Mahara instance
  - DO NOT enable the LTI plugin
  - Add an External App ( Site admin > Web services > External apps ) 
  - Delete the External App - confirm yes,you want to delete.
  - The following error is generated:

  
  [WAR] bd (lib/errors.php:853) Failed to get a recordset: postgres8 error: [-18: ERROR:  relation "lti_assessment" does not exist
  LINE 1: DELETE FROM "lti_assessment"
                      ^] in EXECUTE("
                                  DELETE FROM "lti_assessment"
                                  WHERE oauthserver = ?
                                  ")Command was:
                                  DELETE FROM "lti_assessment"
                                  WHERE oauthserver = ?
                                  and values was (0:1)

  
  Call stack (most recent first):
  log_message("Failed to get a recordset: postgres8 error: [-18: ...", 8, true, true) at /siteroot/htdocs/lib/errors.php:89
  log_warn("Failed to get a recordset: postgres8 error: [-18: ...") at /siteroot/htdocs/lib/errors.php:853
  SQLException->__construct("Failed to get a recordset: postgres8 error: [-18: ...") at /siteroot/htdocs/lib/dml.php:1156
  delete_records_sql(" DELETE FROM "lti_...", array(size 1)) at /siteroot/htdocs/webservice/admin/oauthv1sregister.php:143
  webservices_server_submit(object(Pieform), array(size 4)) at /siteroot/htdocs/lib/pieforms/pieform.php:568
  Pieform->__construct(array(size 7)) at /siteroot/htdocs/lib/pieforms/pieform.php:168
  Pieform::process(array(size 7)) at /siteroot/htdocs/lib/mahara.php:5499
  pieform(array(size 7)) at /siteroot/htdocs/webservice/admin/oauthv1sregister.php:558
  webservice_server_list_form(array(size 7), array(size 2)) at /siteroot/htdocs/webservice/admin/oauthv1sregister.php:68

  
  The reason is because the table from the LTI plugin was never installed. A check that the table exists needs to be applied first. Please note - check not that the plugin is enabled but if the table exists.

  A situation can arise where the plugin was installed, some data is in
  the table, then the plugin is disabled. Disabling a plugin does not
  remove its existing data/tables.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1928999/+subscriptions


References