From efd7cc73c20c9e5011936e71bdfd312e20421997 Mon Sep 17 00:00:00 2001 From: nruest Date: Fri, 5 Sep 2014 12:13:22 -0400 Subject: [PATCH 01/23] ISLANDORA-1042 -- DESTROY ALL DEPRECATED CODE! --- includes/ingest.form.inc | 27 ----------------------- includes/utilities.inc | 47 ---------------------------------------- islandora.module | 28 ------------------------ 3 files changed, 102 deletions(-) diff --git a/includes/ingest.form.inc b/includes/ingest.form.inc index b5a4740d..6af93d63 100644 --- a/includes/ingest.form.inc +++ b/includes/ingest.form.inc @@ -136,33 +136,6 @@ function islandora_ingest_form_get_last_step_id(array &$form_state) { return array_pop($keys); } -/** - * Prepares a new object based on the given configuration. - * - * @param array $configuration - * The list of key/value pairs of configuration. - * - * @return NewFedoraObject - * The new object. - */ -function islandora_ingest_form_prepare_new_object(array $configuration) { - module_load_include('inc', 'islandora', 'includes/utilities'); - if (empty($configuration['object'])) { - $message = islandora_deprecated('7.x-1.2', t('Please use "objects" as the default ingest form configuration property.')); - trigger_error(filter_xss($message), E_USER_DEPRECATED); - // ID is more specific than namespace so it will take precedence. - $id = isset($configuration['namespace']) ? $configuration['namespace'] : 'islandora'; - $id = isset($configuration['id']) ? $configuration['id'] : $id; - $label = isset($configuration['label']) ? $configuration['label'] : 'New Object'; - $relationship_map = function($o) { - return array('relationship' => 'isMemberOfCollection', 'pid' => $o); - }; - $relationships = empty($configuration['collections']) ? array() : array_map($relationship_map, $configuration['collections']); - return islandora_prepare_new_object($id, $label, array(), array(), $relationships); - } - return $configuration['object']; -} - /** * Gets the given/current step. * diff --git a/includes/utilities.inc b/includes/utilities.inc index 26633df5..38b229d1 100644 --- a/includes/utilities.inc +++ b/includes/utilities.inc @@ -649,53 +649,6 @@ function islandora_system_settings_form_default_value($name, $default_value, arr return isset($form_state['values'][$name]) ? $form_state['values'][$name] : variable_get($name, $default_value); } -/** - * Checks that the given/current account has all the given permissions. - * - * @param array $perms - * The permissions to check. - * @param mixed $account - * (optional) The account to check, if not given use currently logged in user. - * - * @return bool - * TRUE if the account has all the given permissions, FALSE otherwise. - */ -function islandora_user_access_all(array $perms, $account = NULL) { - $message = islandora_deprecated('7.x-1.2', 'Roll your own code or use islandora_user_access().'); - trigger_error(filter_xss($message), E_USER_DEPRECATED); - - foreach ($perms as $perm) { - if (!user_access($perm, $account)) { - return FALSE; - } - } - return TRUE; -} - -/** - * Checks that the given/current account has at one of the given permissions. - * - * @param array $perms - * The permissions to check. - * @param mixed $account - * (optional) The account to check, if not given use currently logged in user. - * - * @return bool - * TRUE if the account has at least one of the given permissions, FALSE - * otherwise. - */ -function islandora_user_access_any(array $perms, $account = NULL) { - $message = islandora_deprecated('7.x-1.2', 'Roll your own code or use islandora_user_access().'); - trigger_error(filter_xss($message), E_USER_DEPRECATED); - - foreach ($perms as $perm) { - if (user_access($perm, $account)) { - return TRUE; - } - } - return FALSE; -} - /** * Gets the list of allowed namespaces as defined by 'islandora_pids_allowed'. * diff --git a/islandora.module b/islandora.module index f0bf796b..06039a5a 100644 --- a/islandora.module +++ b/islandora.module @@ -815,34 +815,6 @@ function islandora_object_access_callback($perm, $object = NULL) { return islandora_object_access($perm, $object); } -/** - * Checks whether the user can access the given object and datastream. - * - * Checks for object existance, accessiblitly, namespace permissions, - * and user permissions - * - * @param string $perm - * The user permission to test for. - * @param AbstractObject $object - * The object to test, if NULL given the object doesn't exist or is - * inaccessible. - * @param AbstractDatastream $datastream - * The datastream to test, if NULL given the datastream doesn't exist - * or is inaccessible. - * @param StdObject $account - * The account to test permissions as or NULL for current user. - * - * @return bool - * TRUE if the user is allowed to access this object, FALSE otherwise. - */ -function islandora_object_datastream_access_callback($perm, $object = NULL, $datastream = NULL, $account = NULL) { - module_load_include('inc', 'islandora', 'includes/utilities'); - $message = islandora_deprecated('7.x-1.2', 'Use islandora_datastream_access().'); - trigger_error(filter_xss($message), E_USER_DEPRECATED); - - return islandora_datastream_access($perm, $datastream, $account); -} - /** * Checks whether the user can access the given object and datastream. * From 690fb4c70ebd61360d8e95188a71d65487248738 Mon Sep 17 00:00:00 2001 From: nruest Date: Mon, 15 Sep 2014 08:17:50 -0400 Subject: [PATCH 02/23] Put function islandora_ingest_form_prepare_new_object back in. --- includes/ingest.form.inc | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/includes/ingest.form.inc b/includes/ingest.form.inc index 6af93d63..1187c55b 100644 --- a/includes/ingest.form.inc +++ b/includes/ingest.form.inc @@ -136,6 +136,33 @@ function islandora_ingest_form_get_last_step_id(array &$form_state) { return array_pop($keys); } +/** + * Prepares a new object based on the given configuration. + * + * @param array $configuration + * The list of key/value pairs of configuration. + * + * @return NewFedoraObject + * The new object. + */ +function islandora_ingest_form_prepare_new_object(array $configuration) { + module_load_include('inc', 'islandora', 'includes/utilities'); + if (empty($configuration['object'])) { + $message = islandora_deprecated('7.x-1.2', t('Please use "objects" as the default ingest form configuration property.')); + trigger_error(filter_xss($message), E_USER_DEPRECATED); + // ID is more specific than namespace so it will take precedence. + $id = isset($configuration['namespace']) ? $configuration['namespace'] : 'islandora'; + $id = isset($configuration['id']) ? $configuration['id'] : $id; + $label = isset($configuration['label']) ? $configuration['label'] : 'New Object'; + $relationship_map = function($o) { + return array('relationship' => 'isMemberOfCollection', 'pid' => $o); + }; + $relationships = empty($configuration['collections']) ? array() : array_map($relationship_map, $configuration['collections']); + return islandora_prepare_new_object($id, $label, array(), array(), $relationships); + } + return $configuration['object']; +} + /** * Gets the given/current step. * From 83f24859add77656fb9764c31a176c223df999fe Mon Sep 17 00:00:00 2001 From: nruest Date: Mon, 15 Sep 2014 11:50:16 -0400 Subject: [PATCH 03/23] Re-remove islandora_ingest_form_prepare_new_object && call to it in function islandora_ingest_form. --- includes/ingest.form.inc | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/includes/ingest.form.inc b/includes/ingest.form.inc index 1187c55b..a95e1b25 100644 --- a/includes/ingest.form.inc +++ b/includes/ingest.form.inc @@ -81,9 +81,6 @@ function islandora_ingest_form(array $form, array &$form_state, array $configura function islandora_ingest_form_init_form_state_storage(array &$form_state, array $configuration) { if (empty($form_state['islandora'])) { $objects = isset($configuration['objects']) ? $configuration['objects'] : array(); - if (empty($objects)) { - $objects[] = islandora_ingest_form_prepare_new_object($configuration); - } $configuration['models'] = isset($configuration['models']) ? $configuration['models'] : array(); // Make sure the models actually exist. foreach ($configuration['models'] as $key => $model) { @@ -136,33 +133,6 @@ function islandora_ingest_form_get_last_step_id(array &$form_state) { return array_pop($keys); } -/** - * Prepares a new object based on the given configuration. - * - * @param array $configuration - * The list of key/value pairs of configuration. - * - * @return NewFedoraObject - * The new object. - */ -function islandora_ingest_form_prepare_new_object(array $configuration) { - module_load_include('inc', 'islandora', 'includes/utilities'); - if (empty($configuration['object'])) { - $message = islandora_deprecated('7.x-1.2', t('Please use "objects" as the default ingest form configuration property.')); - trigger_error(filter_xss($message), E_USER_DEPRECATED); - // ID is more specific than namespace so it will take precedence. - $id = isset($configuration['namespace']) ? $configuration['namespace'] : 'islandora'; - $id = isset($configuration['id']) ? $configuration['id'] : $id; - $label = isset($configuration['label']) ? $configuration['label'] : 'New Object'; - $relationship_map = function($o) { - return array('relationship' => 'isMemberOfCollection', 'pid' => $o); - }; - $relationships = empty($configuration['collections']) ? array() : array_map($relationship_map, $configuration['collections']); - return islandora_prepare_new_object($id, $label, array(), array(), $relationships); - } - return $configuration['object']; -} - /** * Gets the given/current step. * From 9a2ac4c7a1009db88f4ce8cfa56445b2c3e6f3a5 Mon Sep 17 00:00:00 2001 From: nruest Date: Mon, 15 Sep 2014 12:36:06 -0400 Subject: [PATCH 04/23] Remove ternary. --- includes/ingest.form.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/ingest.form.inc b/includes/ingest.form.inc index a95e1b25..9525e410 100644 --- a/includes/ingest.form.inc +++ b/includes/ingest.form.inc @@ -80,7 +80,7 @@ function islandora_ingest_form(array $form, array &$form_state, array $configura */ function islandora_ingest_form_init_form_state_storage(array &$form_state, array $configuration) { if (empty($form_state['islandora'])) { - $objects = isset($configuration['objects']) ? $configuration['objects'] : array(); + $objects = isset($configuration['objects']) : array(); $configuration['models'] = isset($configuration['models']) ? $configuration['models'] : array(); // Make sure the models actually exist. foreach ($configuration['models'] as $key => $model) { From 9ef4065c37d6db964c9572d16c369fa5586ea4f2 Mon Sep 17 00:00:00 2001 From: qadan Date: Mon, 19 Jan 2015 11:10:09 -0400 Subject: [PATCH 05/23] coder specify --- tests/scripts/travis_setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/scripts/travis_setup.sh b/tests/scripts/travis_setup.sh index 22fe9d7c..95405c80 100755 --- a/tests/scripts/travis_setup.sh +++ b/tests/scripts/travis_setup.sh @@ -38,7 +38,7 @@ ln -s $ISLANDORA_DIR sites/all/modules/islandora mv sites/all/modules/islandora/tests/travis.test_config.ini sites/all/modules/islandora/tests/test_config.ini mkdir sites/all/libraries ln -s $HOME/tuque sites/all/libraries/tuque -drush dl --yes coder +drush dl --yes coder-7.x-2.4 drush dl --yes potx-7.x-1.0 drush en --yes coder_review drush en --yes simpletest From 043be501791f3953dbeaa772fd11a0bc56d83a67 Mon Sep 17 00:00:00 2001 From: MorganDawe Date: Thu, 18 Dec 2014 15:48:20 -0400 Subject: [PATCH 06/23] Added print icon as an option in islandora administration page. --- includes/admin.form.inc | 6 ++++++ islandora.module | 28 +++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/includes/admin.form.inc b/includes/admin.form.inc index 42612ea0..51116f5c 100644 --- a/includes/admin.form.inc +++ b/includes/admin.form.inc @@ -68,6 +68,12 @@ function islandora_repository_admin(array $form, array &$form_state) { useful if derivatives are to be created by an external service.'), '#default_value' => variable_get('islandora_defer_derivatives_on_ingest', FALSE), ), + 'islandora_show_print_option' => array( + '#type' => 'checkbox', + '#title' => t('Show print option on objects'), + '#description' => t('Displays an extra print tab, allowing an object to be printed'), + '#default_value' => variable_get('islandora_show_print_option', FALSE), + ), ), 'islandora_namespace' => array( '#type' => 'fieldset', diff --git a/islandora.module b/islandora.module index 31986877..8821aff6 100644 --- a/islandora.module +++ b/islandora.module @@ -147,7 +147,7 @@ function islandora_menu() { 'page callback' => 'islandora_printer_object', 'page arguments' => array(2), 'type' => MENU_LOCAL_TASK, - 'access callback' => 'islandora_object_access', + 'access callback' => 'islandora_print_object_access', 'access arguments' => array(ISLANDORA_VIEW_OBJECTS, 2), ); $items['islandora/object/%islandora_object/print'] = array( @@ -663,6 +663,31 @@ function islandora_print_object(AbstractObject $object) { return theme('islandora_object_print', array('object' => $object)); } +/** + * View print tab access. + * + * Configurable option in islandora configuration. + * + * @param string $op + * String identifying an operation to check. Should correspond to a + * permission declared via hook_permission(). + * @param AbstractObject $object + * An object to check for permissions. + * + * @return bool + * TRUE if at least one implementation of hook_islandora_object_access() + * returned TRUE, and no implementation return FALSE; FALSE otherwise, or + * FALSE if 'islandora_show_print_option' is not selected in islandora + * configuraton. + */ +function islandora_print_object_access($one, $two) { + $access = islandora_object_access($one, $two); + if ($access && variable_get('islandora_show_print_option', FALSE)) { + return $access; + } + return FALSE; +} + /** * Implements hook_forms(). */ @@ -1070,6 +1095,7 @@ function islandora_view_object(AbstractObject $object) { function islandora_printer_object(AbstractObject $object) { $output = array(); $temp_arr = array(); + // Dispatch print hook. foreach (islandora_build_hook_list(ISLANDORA_PRINT_HOOK, $object->models) as $hook) { $temp = module_invoke_all($hook, $object); From 7c27b78b8af38bb7e4b255753810fb608aedc77c Mon Sep 17 00:00:00 2001 From: MorganDawe Date: Thu, 18 Dec 2014 15:54:16 -0400 Subject: [PATCH 07/23] Changed parameter names. --- islandora.module | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/islandora.module b/islandora.module index 8821aff6..dfd9a53e 100644 --- a/islandora.module +++ b/islandora.module @@ -680,8 +680,8 @@ function islandora_print_object(AbstractObject $object) { * FALSE if 'islandora_show_print_option' is not selected in islandora * configuraton. */ -function islandora_print_object_access($one, $two) { - $access = islandora_object_access($one, $two); +function islandora_print_object_access($op, $object) { + $access = islandora_object_access($op, $object); if ($access && variable_get('islandora_show_print_option', FALSE)) { return $access; } From 3900ae5e1df42083c7e3414c6540fa7583df0dd7 Mon Sep 17 00:00:00 2001 From: Rosie Le Faive Date: Wed, 21 Jan 2015 12:40:14 -0400 Subject: [PATCH 08/23] Avoid unnecessary access call --- islandora.module | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/islandora.module b/islandora.module index dfd9a53e..270edf4e 100644 --- a/islandora.module +++ b/islandora.module @@ -663,7 +663,7 @@ function islandora_print_object(AbstractObject $object) { return theme('islandora_object_print', array('object' => $object)); } -/** +/** * View print tab access. * * Configurable option in islandora configuration. @@ -681,11 +681,11 @@ function islandora_print_object(AbstractObject $object) { * configuraton. */ function islandora_print_object_access($op, $object) { - $access = islandora_object_access($op, $object); - if ($access && variable_get('islandora_show_print_option', FALSE)) { - return $access; + if (!variable_get('islandora_show_print_option', FALSE)) { + return FALSE; } - return FALSE; + $access = islandora_object_access($op, $object); + return $access; } /** From 7323411bb67ec7f25205b473632b42b95086ec79 Mon Sep 17 00:00:00 2001 From: Mark Jordan Date: Thu, 22 Jan 2015 09:18:20 -0800 Subject: [PATCH 09/23] Address ISLANDORA-1162 --- islandora.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/islandora.module b/islandora.module index 270edf4e..fba7206a 100644 --- a/islandora.module +++ b/islandora.module @@ -1976,7 +1976,7 @@ function islandora_islandora_datastream_access($op, AbstractDatastream $datastre $hooks = islandora_invoke_hook_list(ISLANDORA_DERVIATIVE_CREATION_HOOK, $object->models, array($object)); $hooks = islandora_filter_derivatives($hooks, array('force' => TRUE), $object); foreach ($hooks as $hook) { - if ($hook['destination_dsid'] == $datastream->id && + if (isset($hook['destination_dsid']) && $hook['destination_dsid'] == $datastream->id && (is_null($hook['source_dsid']) || islandora_datastream_access(ISLANDORA_VIEW_OBJECTS, $object[$hook['source_dsid']], $user))) { $applicable_hook = TRUE; break; From f8864a2a76fa7a7e488b23e1ca33dc4933fdb7ae Mon Sep 17 00:00:00 2001 From: Jordan Dukart Date: Fri, 23 Jan 2015 11:28:56 -0400 Subject: [PATCH 10/23] Expand temp file MIME type sniffing. --- includes/utilities.inc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/utilities.inc b/includes/utilities.inc index 7476948b..1459b0a5 100644 --- a/includes/utilities.inc +++ b/includes/utilities.inc @@ -72,6 +72,9 @@ function islandora_temp_file_entry($file_uri, $mime = NULL) { if (isset($mime)) { $file->filemime = $mime; } + else { + $file->filemime = file_get_mimetype($file_uri); + } } $file->status = 0; return file_save($file); From 598e68980e66f95d2a659e3aa64df876c776ccfc Mon Sep 17 00:00:00 2001 From: Adam Vessey Date: Mon, 26 Jan 2015 14:58:23 -0400 Subject: [PATCH 11/23] Allow "islandora_object" entities to be loaded. Should allow objects to be loaded in Rules, by specifying the "id" as a property. (trying to load by "id" directly is not possibly, since Rules assumes that IDs are numeric) --- includes/object.entity_controller.inc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/includes/object.entity_controller.inc b/includes/object.entity_controller.inc index 87b5e4de..dfd2d2fd 100644 --- a/includes/object.entity_controller.inc +++ b/includes/object.entity_controller.inc @@ -29,9 +29,13 @@ class IslandoraObjectEntityController implements DrupalEntityControllerInterface * An array of loaded objects. */ public function load($ids = array(), $conditions = array()) { - if (!empty($conditions)) { - // TODO: Allow loading by specifying IDs in the condition. - throw new Exception('Conditions not implemented.'); + if (isset($conditions['id'])) { + // Allow loading by specifying the ID as a property as a work-around, + // since some components dealing with entities expect IDs to be numeric. + $ids = array_merge($ids, (array) $conditions['id']); + } + elseif (!empty($conditions)) { + throw new Exception('Conditions other than "id" not implemented.'); } $loaded = array(); From 8641c469e38c994b5880600161df17c4c18c8744 Mon Sep 17 00:00:00 2001 From: Adam Vessey Date: Mon, 26 Jan 2015 15:00:58 -0400 Subject: [PATCH 12/23] Avoid watchdogging "Cache rebuild lock hit: event_islandora_*" stuff. --- includes/utilities.inc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/includes/utilities.inc b/includes/utilities.inc index 1459b0a5..4786e362 100644 --- a/includes/utilities.inc +++ b/includes/utilities.inc @@ -197,11 +197,14 @@ function islandora_invoke_hook_list($hook, array $refinements, array $args) { $return = array_merge_recursive($return, $result); array_shift($args); } - if (module_exists('rules') && $event = rules_get_cache("event_$hook")) { - $parameters = $event->parameterInfo(); - $rule_args = array_slice($args, 0, count($parameters)); - array_unshift($rule_args, $hook); - $result = call_user_func_array('rules_invoke_event', $rule_args); + if (module_exists('rules')) { + $event_info = rules_get_event_info($hook); + if (isset($event_info['module'])) { + $parameters = $event_info['variables']; + $rule_args = array_slice($args, 0, count($parameters)); + array_unshift($rule_args, $hook); + $result = call_user_func_array('rules_invoke_event', $rule_args); + } } return $return; } From 88304774a9692d3d8bf59cd7f95ee88edd31a74c Mon Sep 17 00:00:00 2001 From: Adam Vessey Date: Mon, 26 Jan 2015 17:20:34 -0400 Subject: [PATCH 13/23] Revert "Allow "islandora_object" entities to be loaded." This reverts commit 598e68980e66f95d2a659e3aa64df876c776ccfc. --- includes/object.entity_controller.inc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/includes/object.entity_controller.inc b/includes/object.entity_controller.inc index dfd2d2fd..87b5e4de 100644 --- a/includes/object.entity_controller.inc +++ b/includes/object.entity_controller.inc @@ -29,13 +29,9 @@ class IslandoraObjectEntityController implements DrupalEntityControllerInterface * An array of loaded objects. */ public function load($ids = array(), $conditions = array()) { - if (isset($conditions['id'])) { - // Allow loading by specifying the ID as a property as a work-around, - // since some components dealing with entities expect IDs to be numeric. - $ids = array_merge($ids, (array) $conditions['id']); - } - elseif (!empty($conditions)) { - throw new Exception('Conditions other than "id" not implemented.'); + if (!empty($conditions)) { + // TODO: Allow loading by specifying IDs in the condition. + throw new Exception('Conditions not implemented.'); } $loaded = array(); From ae64d3e26040c8550f5db4b78ec415ebf9b69435 Mon Sep 17 00:00:00 2001 From: nruest Date: Tue, 27 Jan 2015 10:24:18 -0500 Subject: [PATCH 14/23] Actually remove the ternary. --- includes/ingest.form.inc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/ingest.form.inc b/includes/ingest.form.inc index 7f355148..530c05c9 100644 --- a/includes/ingest.form.inc +++ b/includes/ingest.form.inc @@ -80,7 +80,10 @@ function islandora_ingest_form(array $form, array &$form_state, array $configura */ function islandora_ingest_form_init_form_state_storage(array &$form_state, array $configuration) { if (empty($form_state['islandora'])) { - $objects = isset($configuration['objects']) : array(); + $objects = isset($configuration['objects']); + if (empty($objects)) { + $objects[] = islandora_ingest_form_prepare_new_object($configuration); + } $configuration['models'] = isset($configuration['models']) ? $configuration['models'] : array(); // Make sure the models actually exist. foreach ($configuration['models'] as $key => $model) { From 8618f8e7cd80d5e9735032a237fc27ae1bbbbf2d Mon Sep 17 00:00:00 2001 From: nruest Date: Tue, 27 Jan 2015 10:53:49 -0500 Subject: [PATCH 15/23] Looks like ternary needs to be there, or it blows up solution pack collection ingest downstream. --- includes/ingest.form.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/ingest.form.inc b/includes/ingest.form.inc index 530c05c9..8cda9160 100644 --- a/includes/ingest.form.inc +++ b/includes/ingest.form.inc @@ -80,7 +80,7 @@ function islandora_ingest_form(array $form, array &$form_state, array $configura */ function islandora_ingest_form_init_form_state_storage(array &$form_state, array $configuration) { if (empty($form_state['islandora'])) { - $objects = isset($configuration['objects']); + $objects = isset($configuration['objects']) ? $configuration['objects'] : array(); if (empty($objects)) { $objects[] = islandora_ingest_form_prepare_new_object($configuration); } From 0975818bd0f4a0b8a9c209e0f8f766f259bb573d Mon Sep 17 00:00:00 2001 From: willtp87 Date: Thu, 29 Jan 2015 16:15:09 -0400 Subject: [PATCH 16/23] Simplification as single object entry is deprecated. --- includes/ingest.form.inc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/includes/ingest.form.inc b/includes/ingest.form.inc index 8cda9160..dc9064f1 100644 --- a/includes/ingest.form.inc +++ b/includes/ingest.form.inc @@ -80,10 +80,6 @@ function islandora_ingest_form(array $form, array &$form_state, array $configura */ function islandora_ingest_form_init_form_state_storage(array &$form_state, array $configuration) { if (empty($form_state['islandora'])) { - $objects = isset($configuration['objects']) ? $configuration['objects'] : array(); - if (empty($objects)) { - $objects[] = islandora_ingest_form_prepare_new_object($configuration); - } $configuration['models'] = isset($configuration['models']) ? $configuration['models'] : array(); // Make sure the models actually exist. foreach ($configuration['models'] as $key => $model) { @@ -91,15 +87,15 @@ function islandora_ingest_form_init_form_state_storage(array &$form_state, array unset($configuration['models'][$key]); } } - // No need to persist the 'objects' within the configuration. - unset($configuration['objects']); // Required for step hooks. $form_state['islandora'] = array( 'step_id' => NULL, - 'objects' => $objects, + 'objects' => $configuration['objects'], 'shared_storage' => $configuration, 'step_storage' => array(), ); + // No need to persist the 'objects' within the configuration. + unset($configuration['objects']); // Must be called after $form_state['islandora'] is initialized, otherwise, // the values in 'islandora' would not be availible to the step hooks. $form_state['islandora']['step_id'] = islandora_ingest_form_get_first_step_id($form_state); From 813c55e75d7842ea8efb05c209106f27be87ce81 Mon Sep 17 00:00:00 2001 From: Jordan Dukart Date: Tue, 3 Feb 2015 11:00:02 -0400 Subject: [PATCH 17/23] Add an extra class so we can use the spinner elsewhere. --- js/spinner.js | 1 + 1 file changed, 1 insertion(+) diff --git a/js/spinner.js b/js/spinner.js index 0c83f393..dc910af8 100755 --- a/js/spinner.js +++ b/js/spinner.js @@ -44,6 +44,7 @@ spinner.spin(this); $('#edit-next').hide(); $('#edit-prev').hide(); + $('.islandora-spinner-submit').hide(); // Submit the form after a set timeout, this handles problems with // safari, in that safari submits immediately.. if (navigator.userAgent.indexOf('Safari') !== -1 && navigator.userAgent.indexOf('Chrome') === -1) { From d47851d1982a04bd5ffe3ffba0fa97687efe9036 Mon Sep 17 00:00:00 2001 From: Jordan Dukart Date: Wed, 4 Feb 2015 10:34:51 -0400 Subject: [PATCH 18/23] Add our extra class in the process. --- includes/ingest.form.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/ingest.form.inc b/includes/ingest.form.inc index c83b140c..2104e957 100644 --- a/includes/ingest.form.inc +++ b/includes/ingest.form.inc @@ -762,6 +762,7 @@ function islandora_ingest_form_ingest_button_process(array $element) { "$islandora_path/js/spinner.js", ), ); + $element['#attributes']['class'][] = 'islandora-spinner-submit'; return $element; } From 13fac4158ebbb842311cf1d1c9884c74a9820b75 Mon Sep 17 00:00:00 2001 From: MorganDawe Date: Wed, 4 Feb 2015 13:18:24 -0400 Subject: [PATCH 19/23] Added class to print icon. --- islandora.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/islandora.module b/islandora.module index 31986877..8626ca63 100644 --- a/islandora.module +++ b/islandora.module @@ -2010,7 +2010,7 @@ function islandora_menu_local_tasks_alter(&$data, $router_item, $root_path) { if ($tab['#link']['path'] == 'islandora/object/%/print_object') { if ($root_path == 'islandora/object/%') { $islandora_path = drupal_get_path('module', 'islandora'); - $tab['#prefix'] = '
  • '; + $tab['#prefix'] = '
  • '; $tab['#suffix'] = '
  • '; $tab['#theme'] = 'link'; $tab['#text'] = theme('image', array( From fa5d02d89517f00a8c668241ca4e00a631fac819 Mon Sep 17 00:00:00 2001 From: Jordan Dukart Date: Thu, 5 Feb 2015 11:19:13 -0400 Subject: [PATCH 20/23] Don't double encode as drupal_set_title check_plains. --- islandora.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/islandora.module b/islandora.module index fba7206a..d5209c7b 100644 --- a/islandora.module +++ b/islandora.module @@ -1129,7 +1129,7 @@ function islandora_drupal_title(AbstractObject $object) { module_load_include('inc', 'islandora', 'includes/breadcrumb'); drupal_set_breadcrumb(islandora_get_breadcrumbs($object)); - return filter_xss($object->label); + return $object->label; } /** From 89036f1b66681f3591a3736ecd8aeda9c60a16da Mon Sep 17 00:00:00 2001 From: Jordan Dukart Date: Thu, 5 Feb 2015 11:27:29 -0400 Subject: [PATCH 21/23] Minus comment. --- islandora.module | 1 - 1 file changed, 1 deletion(-) diff --git a/islandora.module b/islandora.module index d5209c7b..6b3adcee 100644 --- a/islandora.module +++ b/islandora.module @@ -1117,7 +1117,6 @@ function islandora_printer_object(AbstractObject $object) { * Title callback for drupal title. * * Changes the drupal title to be the objects label. - * models that their modules want to provide a view for. * * @param AbstractObject $object * The object to view. From 8c84ccc5f2a26d515fab21bc732047d2ef6653bb Mon Sep 17 00:00:00 2001 From: Jordan Dukart Date: Thu, 5 Feb 2015 13:58:18 -0400 Subject: [PATCH 22/23] Update comment. --- islandora.module | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/islandora.module b/islandora.module index 6b3adcee..b4105019 100644 --- a/islandora.module +++ b/islandora.module @@ -1122,7 +1122,9 @@ function islandora_printer_object(AbstractObject $object) { * The object to view. * * @return string - * The objects label. + * The objects label. Note that we return the raw value to prevent + * double encoding, as we expect drupal_set_title() to check_plain() down + * the road. */ function islandora_drupal_title(AbstractObject $object) { module_load_include('inc', 'islandora', 'includes/breadcrumb'); From d276979548ff0ede989035944aa472f83d20019b Mon Sep 17 00:00:00 2001 From: willtp87 Date: Wed, 25 Feb 2015 10:44:39 -0400 Subject: [PATCH 23/23] Stopped a notice. --- islandora.rules.inc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/islandora.rules.inc b/islandora.rules.inc index 2562656a..2ebaa519 100644 --- a/islandora.rules.inc +++ b/islandora.rules.inc @@ -406,9 +406,11 @@ function islandora_rules_datastream_load_namespace_vocab($xpath, $xpath_vocab) { /** * Rules XPath helper; grab the datastream content and build a DOMXPath. */ -function islandora_rules_datastream_load_xpath(AbstractDatastream $datastream, $xpath_vocab) { - $result = islandora_rules_datastream_load_domxpath($datastream->content, $xpath_vocab); - islandora_rules_datastream_load_namespace_vocab($result['islandora_domxpath'], $xpath_vocab); +function islandora_rules_datastream_load_xpath(AbstractDatastream $datastream, $xpath_vocab = NULL) { + $result = islandora_rules_datastream_load_domxpath($datastream->content); + if (is_object($xpath_vocab)) { + islandora_rules_datastream_load_namespace_vocab($result['islandora_domxpath'], $xpath_vocab); + } return $result; }