← Back to team overview

mahara-contributors team mailing list archive

[Bug 1287344] A change has been merged

 

Reviewed:  https://reviews.mahara.org/3716
Committed: https://git.mahara.org/mahara/mahara/commit/606eff4ab70c96cd42c624d9eeabc90058e579fb
Submitter: Robert Lyon (robertl@xxxxxxxxxxxxxxx)
Branch:    master

commit 606eff4ab70c96cd42c624d9eeabc90058e579fb
Author: Nigel Cunningham <nigelc@xxxxxxxxxxxxxxx>
Date:   Thu Dec 18 16:10:07 2014 +1100

Bug1287344: Don't try to delete missing artefact plugins' data

Don't try to delete the data of missing artefact plugins when
upgrading. The user might want the data but be unable to get
a matching version at the moment.

behatnotneeded: DB upgrading

Change-Id: I52dfec0d97a4bf36a96ca41823c8203f5abb8c73
Signed-off-by: Nigel Cunningham <nigelc@xxxxxxxxxxxxxxx>

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1287344

Title:
  artefact installed upgrade problem

Status in Mahara:
  Fix Committed

Bug description:
  When there is an artefact plugin missing and one tries to upgrade
  another artefact plugin there is an error:

  [WAR] cb (lib/errors.php:739) Failed to get a recordset: postgres7 error: [-1: ERROR:  update or delete on table "artefact_installed_type" violates foreign key constraint "arte_art_fk" on table "artefact", referer: https://mahara-testing/admin/upgrade.php
  [Tue Mar 04 08:52:46 2014] [error] [client 127.0.0.1] [WAR] cb (lib/errors.php:739) DETAIL:  Key (name)=(socialprofile) is still referenced from table "artefact".] in adodb_throw(DELETE FROM "artefact_installed_type" WHERE (plugin = ? AND name NOT IN (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)), Array), referer: https://mahara-testing/admin/upgrade.php

  This is due to the fact the missing plugin has artefacts in the
  artefact table.

  This line in lib/upgrade.php (approx line 500)
   
              delete_records_select('artefact_installed_type', $select,
                                    array_merge(array($pluginname),$types));

  needs to have some sort of checking if associated items exist for the
  plugin being removed and remove them first (or have some try { } catch
  (Exception $e) {} to let the user know that there was an issue with
  plugin A but still allow plugin B to be upgraded.

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


References