Browse Source

Merge pull request #456 from ajstanley/7.x

Fixed drush command, fixed link display
pull/458/merge
Daniel Lamb 11 years ago
parent
commit
5f947f6e91
  1. 2
      includes/utilities.inc
  2. 29
      islandora.drush.inc

2
includes/utilities.inc

@ -528,7 +528,7 @@ function islandora_display_repository_inaccessible_message() {
$link = l($text, 'admin/islandora/configure', array('attributes' => array('title' => $text))); $link = l($text, 'admin/islandora/configure', array('attributes' => array('title' => $text)));
$message = t('Could not connect to the repository. Please check the settings on the !link page.', $message = t('Could not connect to the repository. Please check the settings on the !link page.',
array('!link' => $link)); array('!link' => $link));
drupal_set_message(check_plain($message), 'error', FALSE); drupal_set_message(filter_xss($message), 'error', FALSE);
} }

29
islandora.drush.inc

@ -176,24 +176,25 @@ function drush_islandora_solution_pack_install_content_models() {
$info = islandora_solution_packs_get_required_objects($module); $info = islandora_solution_packs_get_required_objects($module);
$objects_to_add = array(); $objects_to_add = array();
foreach ($info['objects'] as $key => $candidate) { foreach ($info['objects'] as $key => $candidate) {
$object = islandora_object_load($candidate); if (in_array('fedora-system:ContentModel-3.0', $candidate->models)) {
if (in_array('fedora-system:ContentModel-3.0', $object->models)) {
$objects_to_add[] = $candidate; $objects_to_add[] = $candidate;
} }
} }
foreach ($objects_to_add as $object_to_add) { if (count($objects_to_add) > 0) {
$old_object = islandora_object_load($object_to_add->id); foreach ($objects_to_add as $object_to_add) {
if ($old_object) { $old_object = islandora_object_load($object_to_add->id);
$deleted = islandora_delete_object($old_object); if ($old_object) {
if (!$deleted) { $deleted = islandora_delete_object($old_object);
drush_log(dt('@object did not delete.', array('@object' => $old_object->id), 'error')); if (!$deleted) {
continue; drush_log(dt('@object did not delete.', array('@object' => $old_object->id), 'error'));
continue;
}
}
$new_object = islandora_add_object($object_to_add);
$verb = $deleted ? dt("Replaced") : dt("Added");
if ($new_object) {
drush_print("$verb " . $object_to_add->id . " - " . $object_to_add->label);
} }
}
$new_object = islandora_add_object($object_to_add);
$verb = $deleted ? dt("Replaced") : dt("Added");
if ($new_object) {
drush_log("$verb " . $object_to_add->id . " - " . $object_to_add->label);
} }
} }
} }

Loading…
Cancel
Save