Browse Source

Can now uninstall islandora and dependant solution packs.

Drupal requires modules to be disabled before uninstalling. Thus classes Drupal
would otherwise autoload when needed are no longer present in the registry
during the uninstall hook. Also the required hook for uninstalling
__islandora_required_objects__ is not availible.

Now required classes for uninstalling are manually loaded, and the module file
which contains the __islandora_required_objects__ hook is manually loaded as
well.
pull/430/head
Nigel Banks 11 years ago
parent
commit
05ba4976aa
  1. 9
      includes/solution_packs.inc
  2. 1
      includes/tuque.inc
  3. 1
      islandora.module

9
includes/solution_packs.inc

@ -28,8 +28,17 @@ function islandora_solution_packs_get_required_objects($module = NULL) {
if (!$required_objects) { if (!$required_objects) {
$connection = islandora_get_tuque_connection(); $connection = islandora_get_tuque_connection();
if (isset($module)) {
// The module may be disabled when this function runs, as modules must be
// disabled before they can be uninstalled. We must manually load the
// module file to use it's islandora_required_objects hook.
module_load_include('module', $module, $module);
$required_objects = module_invoke($module, 'islandora_required_objects', $connection);
}
else {
$required_objects = module_invoke_all('islandora_required_objects', $connection); $required_objects = module_invoke_all('islandora_required_objects', $connection);
} }
}
if ($module !== NULL) { if ($module !== NULL) {
if (isset($required_objects[$module])) { if (isset($required_objects[$module])) {

1
includes/tuque.inc

@ -85,6 +85,7 @@ class IslandoraTuque {
} }
if (self::exists()) { if (self::exists()) {
module_load_include('inc', 'islandora', 'includes/tuque_wrapper');
$this->connection = new IslandoraRepositoryConnection($url, $user_string, $pass_string); $this->connection = new IslandoraRepositoryConnection($url, $user_string, $pass_string);
$this->connection->reuseConnection = TRUE; $this->connection->reuseConnection = TRUE;
$this->api = new IslandoraFedoraApi($this->connection); $this->api = new IslandoraFedoraApi($this->connection);

1
islandora.module

@ -1113,6 +1113,7 @@ function islandora_default_islandora_printer_object($object, $alter) {
* A IslandoraTuque instance * A IslandoraTuque instance
*/ */
function islandora_get_tuque_connection($user = NULL, $url = NULL) { function islandora_get_tuque_connection($user = NULL, $url = NULL) {
module_load_include('inc', 'islandora', 'includes/tuque');
$tuque = &drupal_static(__FUNCTION__); $tuque = &drupal_static(__FUNCTION__);
if (!$tuque) { if (!$tuque) {
if (IslandoraTuque::exists()) { if (IslandoraTuque::exists()) {

Loading…
Cancel
Save